RO
pedido

Fazer Um Script Em Area Para Proibir Uma Palavra.

Por Robinhood, 13 de set. de 2012 em Scripts

otserv
tibia
script
11
1.7k
RobinhoodR
13 de setembro de 2012 às 21:21

iai xtibianos! =]

 

Estou querendo um script que faça proibir um jogador de usar uma talkaction em uma area do server. Creio que pode ser uma palavra mesmo.

 

No caso axo que poderia ser por aquelas parada de posição do canto superior esquerdo da tela e posição do canto inferior direito da tela.

 

Tem como alguem fazer isso ae pra IEU?

 

Feitio!drunk.gif

15790911
13 de setembro de 2012 às 21:33

Em creaturescripts.xml

 

<event type="outfit" name="NotOut" event="script" value="nochangeoutifit.lua"/>

 

dps em scripts, cria um arquivo chamado nochangeoutifit.lua e coloque:

 

function onOutfit(cid, old, current)

local from,to = {x=597, y=35, z=7},{x=689, y=49, z=7}

return not isInRange(getCreaturePosition(cid), from, to) and true or false

end

 

Ali nas pos é o canto superior esquerdo e canto inferior direito.

 

Em login.lua:

 

 

registerCreatureEvent(cid, "NotOut")

 

Simples, daí ele vai escrever a talk e o outifit dele nao vai mudar!

Editado Setembro 13 por GuizitoG

VodkartV
13 de setembro de 2012 às 21:50

só que é comando gui, ai ele troca sozin xD

15790911
13 de setembro de 2012 às 21:51

Sooh... nem testei, peguei akele script que se me passo pra ajuda no dota.. no caso ele teria q passa a talk dele e fazer alteraçoes dentro do script?

VodkartV
13 de setembro de 2012 às 21:57

sim, usando a funçao isInRange tbm

15790911
13 de setembro de 2012 às 21:59

RobinHood? Ainda está aí?

Passa seu script aí pro vodk edita aee man..

RobinhoodR
13 de setembro de 2012 às 23:20

To ligado.. eu estava olhando um filmezinho :]

Sorry pela demora.

 

	<talkaction words="transformar" event="script" value="transformar.lua"/>
<talkaction words="reverter" event="script" value="reverter.lua"/>

 

transformar.lua:

 

 

local config = {

--[vocation id] = { level, nova voc, looktype, efeito}

[1] = { 25, 2, 66, 208},

[2] = { 50, 3, 91, 208},

[3] = { 75, 4, 18, 208},

[4] = { 100, 5, 31, 208},

[5] = { 125, 6, 92, 208},

[6] = { 150, 7, 40, 208},

[7] = { 175, 8, 305, 208},

[8] = { 200, 9, 320, 208},

[9] = { 225, 10, 179, 208},

[10] = { 250, 11, 394, 208},

[11] = { 275, 12, 397, 208},

[13] = { 25, 14, 93, 108},

[14] = { 50, 15, 6, 108},

[15] = { 75, 16, 5, 108},

[16] = { 100, 17, 306, 108},

[17] = { 125, 18, 7, 108},

[18] = { 150, 19, 94, 108},

[19] = { 175, 20, 59, 108},

[20] = { 200, 21, 8, 108},

[21] = { 225, 22, 178, 110},

[22] = { 250, 23, 95, 110},

[23] = { 275, 24, 54, 110},

[25] = { 25, 26, 80, 87},

[26] = { 50, 27, 190, 87},

[27] = { 75, 28, 83, 87},

[28] = { 100, 29, 191, 87},

[29] = { 150, 30, 192, 87},

[30] = { 175, 31, 193, 87},

[31] = { 225, 32, 392, 87},

[32] = { 250, 33, 330, 87},

[34] = { 25, 35, 194, 5},

[35] = { 50, 36, 175, 5},

[36] = { 75, 37, 169, 5},

[37] = { 100, 38, 173, 5},

[38] = { 150, 39, 172, 5},

[39] = { 175, 40, 171, 5},

[40] = { 225, 41, 174, 5},

[41] = { 250, 42, 170, 5},

[50] = { 25, 51, 67, 205},

[51] = { 50, 52, 72, 205},

[52] = { 75, 53, 158, 205},

[53] = { 100, 54, 65, 205},

[54] = { 125, 55, 329, 205},

[55] = { 150, 56, 188, 205},

[56] = { 175, 57, 62, 205},

[57] = { 200, 58, 189, 205},

[58] = { 225, 59, 335, 205},

[59] = { 250, 60, 57, 205},

[70] = { 25, 71, 102, 124},

[71] = { 50, 72, 103, 124},

[72] = { 75, 73, 105, 124},

[73] = { 100, 74, 107, 124},

[74] = { 150, 75, 108, 124},

[75] = { 175, 76, 314, 124},

[76] = { 225, 77, 315, 124},

[77] = { 250, 78, 333, 124},

[90] = { 25, 91, 331, 209},

[91] = { 50, 92, 69, 209},

[92] = { 75, 93, 70, 209},

[93] = { 100, 94, 199, 209},

[94] = { 150, 95, 196, 209},

[95] = { 175, 96, 197, 209},

[96] = { 225, 97, 198, 209},

[97] = { 250, 98, 332, 209},

[97] = { 250, 98, 332, 209},

[110] = { 25, 111, 88, 187},

[111] = { 75, 112, 341, 187},

[112] = { 100, 113, 343, 187},

[113] = { 150, 114, 342, 187},

[114] = { 200, 115, 344, 187},

[115] = { 250, 116, 345, 187},

[130] = { 25, 131, 296, 124},

[131] = { 75, 132, 297, 124},

[132] = { 150, 133, 298, 124},

[133] = { 200, 134, 299, 124},

[150] = { 25, 151, 384, 126},

[151] = { 75, 152, 385, 126},

[152] = { 150, 153, 386, 126},

[153] = { 200, 154, 396, 126},

[170] = { 25, 171, 97, 108},

[171] = { 50, 172, 285, 108},

[172] = { 75, 173, 282, 108},

[173] = { 100, 174, 98, 108},

[174] = { 125, 175, 284, 109},

[175] = { 150, 176, 99, 109},

[176] = { 200, 177, 283, 109}

}

function onSay(cid, words, param, channel)

doPlayerSay(cid, "transformar")

local voc = config[getPlayerVocation(cid)]

if voc then

if getPlayerLevel(cid) >= voc[1] then

doPlayerSetVocation(cid, voc[2])

doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Você Transformou!")

local outfit = {lookType = voc[3]}

doCreatureChangeOutfit(cid, outfit)

doSendMagicEffect(getCreaturePosition(cid), voc[4])

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Você precisa estar no level " .. voc[1] .. " para transformar.")

end

else

doPlayerSendCancel(cid, "Você não pode se Transformar!")

end

return true

end

 

 

 

reverter.lua:

 

 

local config = {

--[vocation id] = { level, nova voc, looktype, efeito}

[12] = { 275, 11, 394, 208},

[11] = { 250, 10, 179, 208},

[10] = { 225, 9, 320, 208},

[9] = { 200, 8, 305, 208},

[8] = { 175, 7, 40, 208},

[7] = { 150, 6, 92, 208},

[6] = { 125, 5, 31, 208},

[5] = { 100, 4, 18, 208},

[4] = { 75, 3, 91, 208},

[3] = { 50, 2, 66, 208},

[2] = { 25, 1, 71, 208},

[24] = { 275, 23, 95, 110},

[23] = { 250, 22, 178, 110},

[22] = { 225, 21, 8, 108},

[21] = { 200, 20, 59, 108},

[20] = { 175, 19, 94, 108},

[19] = { 150, 18, 7, 108},

[18] = { 125, 17, 306, 108},

[17] = { 100, 16, 5, 108},

[16] = { 75, 15, 6, 108},

[15] = { 50, 14, 93, 108},

[14] = { 50, 13, 2, 108},

[33] = { 250, 32, 392, 87},

[32] = { 225, 31, 193, 87},

[31] = { 175, 30, 192, 87},

[30] = { 150, 29, 191, 87},

[29] = { 100, 28, 83, 87},

[28] = { 75, 27, 190, 87},

[27] = { 50, 26, 80, 87},

[26] = { 25, 25, 30, 87},

[42] = { 250, 41, 174, 5},

[41] = { 250, 40, 171, 5},

[40] = { 250, 39, 172, 5},

[39] = { 250, 38, 173, 5},

[38] = { 250, 37, 169, 5},

[37] = { 250, 36, 175, 5},

[36] = { 250, 35, 194, 5},

[35] = { 250, 34, 195, 5},

[60] = { 250, 59, 335, 205},

[59] = { 225, 58, 189, 205},

[58] = { 200, 57, 62, 205},

[57] = { 175, 56, 188, 205},

[56] = { 150, 55, 329, 205},

[55] = { 125, 54, 65, 205},

[54] = { 100, 53, 158, 205},

[53] = { 75, 52, 72, 205},

[52] = { 50, 51, 67, 205},

[51] = { 25, 50, 53, 205},

[78] = { 250, 77, 315, 124},

[77] = { 225, 76, 314, 124},

[76] = { 175, 75, 108, 124},

[75] = { 150, 74, 107, 124},

[74] = { 100, 73, 105, 124},

[73] = { 75, 72, 103, 124},

[72] = { 50, 71, 102, 124},

[71] = { 25, 70, 101, 124},

[98] = { 250, 97, 198, 209},

[97] = { 225, 96, 197, 209},

[96] = { 175, 95, 196, 209},

[95] = { 150, 94, 199, 209},

[94] = { 100, 93, 70, 209},

[93] = { 75, 92, 69, 209},

[92] = { 50, 91, 331, 209},

[91] = { 25, 90, 50, 209},

[116] = { 25, 115, 344, 187},

[115] = { 75, 114, 342, 187},

[114] = { 100, 113, 343, 187},

[113] = { 150, 112, 341, 187},

[112] = { 200, 111, 88, 187},

[111] = { 250, 110, 340, 187},

[134] = { 25, 133, 298, 124},

[133] = { 75, 132, 297, 124},

[132] = { 150, 131, 296, 124},

[131] = { 200, 130, 295, 124},

[154] = { 200, 153, 386, 126},

[153] = { 150, 152, 385, 126},

[152] = { 75, 151, 384, 126},

[151] = { 25, 150, 383, 126},

[177] = { 200, 176, 99, 109},

[176] = { 150, 175, 284, 109},

[175] = { 125, 174, 98, 109},

[174] = { 100, 173, 282, 109},

[173] = { 75, 172, 285, 108},

[172] = { 50, 171, 97, 108},

[171] = { 25, 170, 96, 108}

}

function onSay(cid, words, param, channel)

doPlayerSay(cid, "Reverter")

local voc = config[getPlayerVocation(cid)]

if voc then

if getPlayerLevel(cid) >= voc[1] then

doPlayerSetVocation(cid, voc[2])

doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Você Reverteu!")

local outfit = {lookType = voc[3]}

doCreatureChangeOutfit(cid, outfit)

doSendMagicEffect(getCreaturePosition(cid), voc[4])

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Não da pra Reverter consulte um GM.")

end

else

doPlayerSendCancel(cid, "Você não pode se Reverter!")

end

return true

end

 

 

 

Vlw pelas ajuda ai :)

Breve estarei estudando essa lua..opakpkoa

Editado Setembro 13 por Robinhood

VodkartV
14 de setembro de 2012 às 09:19

local config = {
--[vocation id] = { level, nova voc, looktype, efeito}
[1] = { 25, 2, 66, 208},
[2] = { 50, 3, 91, 208},
[3] = { 75, 4, 18, 208},
[4] = { 100, 5, 31, 208},
[5] = { 125, 6, 92, 208},
[6] = { 150, 7, 40, 208},
[7] = { 175, 8, 305, 208},
[8] = { 200, 9, 320, 208},
[9] = { 225, 10, 179, 208},
[10] = { 250, 11, 394, 208},
[11] = { 275, 12, 397, 208},
[13] = { 25, 14, 93, 108},
[14] = { 50, 15, 6, 108},
[15] = { 75, 16, 5, 108},
[16] = { 100, 17, 306, 108},
[17] = { 125, 18, 7, 108},
[18] = { 150, 19, 94, 108},
[19] = { 175, 20, 59, 108},
[20] = { 200, 21, 8, 108},
[21] = { 225, 22, 178, 110},
[22] = { 250, 23, 95, 110},
[23] = { 275, 24, 54, 110},
[25] = { 25, 26, 80, 87},
[26] = { 50, 27, 190, 87},
[27] = { 75, 28, 83, 87},
[28] = { 100, 29, 191, 87},
[29] = { 150, 30, 192, 87},
[30] = { 175, 31, 193, 87},
[31] = { 225, 32, 392, 87},
[32] = { 250, 33, 330, 87},
[34] = { 25, 35, 194, 5},
[35] = { 50, 36, 175, 5},
[36] = { 75, 37, 169, 5},
[37] = { 100, 38, 173, 5},
[38] = { 150, 39, 172, 5},
[39] = { 175, 40, 171, 5},
[40] = { 225, 41, 174, 5},
[41] = { 250, 42, 170, 5},
[50] = { 25, 51, 67, 205},
[51] = { 50, 52, 72, 205},
[52] = { 75, 53, 158, 205},
[53] = { 100, 54, 65, 205},
[54] = { 125, 55, 329, 205},
[55] = { 150, 56, 188, 205},
[56] = { 175, 57, 62, 205},
[57] = { 200, 58, 189, 205},
[58] = { 225, 59, 335, 205},
[59] = { 250, 60, 57, 205},
[70] = { 25, 71, 102, 124},
[71] = { 50, 72, 103, 124},
[72] = { 75, 73, 105, 124},
[73] = { 100, 74, 107, 124},
[74] = { 150, 75, 108, 124},
[75] = { 175, 76, 314, 124},
[76] = { 225, 77, 315, 124},
[77] = { 250, 78, 333, 124},
[90] = { 25, 91, 331, 209},
[91] = { 50, 92, 69, 209},
[92] = { 75, 93, 70, 209},
[93] = { 100, 94, 199, 209},
[94] = { 150, 95, 196, 209},
[95] = { 175, 96, 197, 209},
[96] = { 225, 97, 198, 209},
[97] = { 250, 98, 332, 209},
[97] = { 250, 98, 332, 209},
[110] = { 25, 111, 88, 187},
[111] = { 75, 112, 341, 187},
[112] = { 100, 113, 343, 187},
[113] = { 150, 114, 342, 187},
[114] = { 200, 115, 344, 187},
[115] = { 250, 116, 345, 187},
[130] = { 25, 131, 296, 124},
[131] = { 75, 132, 297, 124},
[132] = { 150, 133, 298, 124},
[133] = { 200, 134, 299, 124},
[150] = { 25, 151, 384, 126},
[151] = { 75, 152, 385, 126},
[152] = { 150, 153, 386, 126},
[153] = { 200, 154, 396, 126},
[170] = { 25, 171, 97, 108},
[171] = { 50, 172, 285, 108},
[172] = { 75, 173, 282, 108},
[173] = { 100, 174, 98, 108},
[174] = { 125, 175, 284, 109},
[175] = { 150, 176, 99, 109},
[176] = { 200, 177, 283, 109}
}
function onSay(cid, words, param, channel)
local from,to = {x=597, y=35, z=7},{x=689, y=49, z=7} -- começo e final do mapa
if isInRange(getCreaturePosition(cid), from, to) then
doPlayerSendCancel(cid, "Você não pode se Transformar nesta área!") return true
end
doPlayerSay(cid, "transformar")
local voc = config[getPlayerVocation(cid)]
if voc then
if getPlayerLevel(cid) >= voc[1] then
doPlayerSetVocation(cid, voc[2])
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Você Transformou!")
local outfit = {lookType = voc[3]}
doCreatureChangeOutfit(cid, outfit)
doSendMagicEffect(getCreaturePosition(cid), voc[4])
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Você precisa estar no level " .. voc[1] .. " para transformar.")
end
else
doPlayerSendCancel(cid, "Você não pode se Transformar!")
end
return true
end

 

revert

local config = {
--[vocation id] = { level, nova voc, looktype, efeito}
[12] = { 275, 11, 394, 208},
[11] = { 250, 10, 179, 208},
[10] = { 225, 9, 320, 208},
[9] = { 200, 8, 305, 208},
[8] = { 175, 7, 40, 208},
[7] = { 150, 6, 92, 208},
[6] = { 125, 5, 31, 208},
[5] = { 100, 4, 18, 208},
[4] = { 75, 3, 91, 208},
[3] = { 50, 2, 66, 208},
[2] = { 25, 1, 71, 208},
[24] = { 275, 23, 95, 110},
[23] = { 250, 22, 178, 110},
[22] = { 225, 21, 8, 108},
[21] = { 200, 20, 59, 108},
[20] = { 175, 19, 94, 108},
[19] = { 150, 18, 7, 108},
[18] = { 125, 17, 306, 108},
[17] = { 100, 16, 5, 108},
[16] = { 75, 15, 6, 108},
[15] = { 50, 14, 93, 108},
[14] = { 50, 13, 2, 108},
[33] = { 250, 32, 392, 87},
[32] = { 225, 31, 193, 87},
[31] = { 175, 30, 192, 87},
[30] = { 150, 29, 191, 87},
[29] = { 100, 28, 83, 87},
[28] = { 75, 27, 190, 87},
[27] = { 50, 26, 80, 87},
[26] = { 25, 25, 30, 87},
[42] = { 250, 41, 174, 5},
[41] = { 250, 40, 171, 5},
[40] = { 250, 39, 172, 5},
[39] = { 250, 38, 173, 5},
[38] = { 250, 37, 169, 5},
[37] = { 250, 36, 175, 5},
[36] = { 250, 35, 194, 5},
[35] = { 250, 34, 195, 5},
[60] = { 250, 59, 335, 205},
[59] = { 225, 58, 189, 205},
[58] = { 200, 57, 62, 205},
[57] = { 175, 56, 188, 205},
[56] = { 150, 55, 329, 205},
[55] = { 125, 54, 65, 205},
[54] = { 100, 53, 158, 205},
[53] = { 75, 52, 72, 205},
[52] = { 50, 51, 67, 205},
[51] = { 25, 50, 53, 205},
[78] = { 250, 77, 315, 124},
[77] = { 225, 76, 314, 124},
[76] = { 175, 75, 108, 124},
[75] = { 150, 74, 107, 124},
[74] = { 100, 73, 105, 124},
[73] = { 75, 72, 103, 124},
[72] = { 50, 71, 102, 124},
[71] = { 25, 70, 101, 124},
[98] = { 250, 97, 198, 209},
[97] = { 225, 96, 197, 209},
[96] = { 175, 95, 196, 209},
[95] = { 150, 94, 199, 209},
[94] = { 100, 93, 70, 209},
[93] = { 75, 92, 69, 209},
[92] = { 50, 91, 331, 209},
[91] = { 25, 90, 50, 209},
[116] = { 25, 115, 344, 187},
[115] = { 75, 114, 342, 187},
[114] = { 100, 113, 343, 187},
[113] = { 150, 112, 341, 187},
[112] = { 200, 111, 88, 187},
[111] = { 250, 110, 340, 187},
[134] = { 25, 133, 298, 124},
[133] = { 75, 132, 297, 124},
[132] = { 150, 131, 296, 124},
[131] = { 200, 130, 295, 124},
[154] = { 200, 153, 386, 126},
[153] = { 150, 152, 385, 126},
[152] = { 75, 151, 384, 126},
[151] = { 25, 150, 383, 126},
[177] = { 200, 176, 99, 109},
[176] = { 150, 175, 284, 109},
[175] = { 125, 174, 98, 109},
[174] = { 100, 173, 282, 109},
[173] = { 75, 172, 285, 108},
[172] = { 50, 171, 97, 108},
[171] = { 25, 170, 96, 108}
}
function onSay(cid, words, param, channel)
local from,to = {x=597, y=35, z=7},{x=689, y=49, z=7} -- começo e final do mapa
if isInRange(getCreaturePosition(cid), from, to) then
doPlayerSendCancel(cid, "Você não pode se Transformar nesta área!") return true
end
doPlayerSay(cid, "Reverter")
local voc = config[getPlayerVocation(cid)]
if voc then
if getPlayerLevel(cid) >= voc[1] then
doPlayerSetVocation(cid, voc[2])
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Você Reverteu!")
local outfit = {lookType = voc[3]}
doCreatureChangeOutfit(cid, outfit)
doSendMagicEffect(getCreaturePosition(cid), voc[4])
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Não da pra Reverter consulte um GM.")
end
else
doPlayerSendCancel(cid, "Você não pode se Reverter!")
end
return true
end

RobinhoodR
14 de setembro de 2012 às 12:58

Você é o cara! Hahaha

 

Funcionou com perfeição :)

 

Se caso o local que eu fis tiver 2 Pisos posso usar aquela função que você fes dessa maneira né?

 

function onSay(cid, words, param, channel)
local from2,to2 = {x=598, y=35, z=8},{x=690, y=49, z=8} -- começo e final do mapa
if isInRange(getCreaturePosition(cid), from2, to2) then
doPlayerSendCancel(cid, "Você não pode se Transformar nesta área!") return true
end

Editado Setembro 14 por Robinhood

VodkartV
14 de setembro de 2012 às 13:06

pode, mas no caso daria para usar 'or'

 

exemplo:

 

local from,to = {x=598, y=35, z=7},{x=690, y=49, z=7} -- começo e final do mapa
local from1,to1 = {x=598, y=35, z=8},{x=690, y=49, z=8} -- começo e final do mapa 2
if isInRange(getCreaturePosition(cid), from, to) or isInRange(getCreaturePosition(cid), from1, to1) then
doPlayerSendCancel(cid, "Você não pode se Transformar nesta área!") return true
end

RobinhoodR
14 de setembro de 2012 às 13:09

Bah! Obrigado pela força meu 10.

 

Pedido e Duvida Sanada :)