Pra saber se um player está com battle lock, você usa:
getCreatureCondition(player, CONDITION_INFIGHT)
Que retorna true se estiver e fasle se não estiver.
By FlamesAdmin, 12 de jul. de 2015 in Resolvidos
Pra saber se um player está com battle lock, você usa:
getCreatureCondition(player, CONDITION_INFIGHT)
Que retorna true se estiver e fasle se não estiver.
info
Group: Campones
Joined: 14/10/13
Posts: 55
Reputation: +19

Ficando assim:
function onSay(cid, words, param)
local storage = 23564
local tempo = 30
if getCreatureCondition(cid, CONDITION_INFIGHT) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você não pode usar enquanto estiver lutando.")
return true
end
if exhaustion.check(cid, storage) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar esse comando novamente.")
return true
end
pos = {x=1023, y=1016, z=6}
doSendMagicEffect(getPlayerPosition(cid),19)
doPlayerSendCancel(cid,"Teleportado!")
doTeleportThing(cid,pos)
exhaustion.set(cid, storage, tempo*60)
return true
end
info
Group: Infante
Joined: 22/12/12
Posts: 2k
Reputation: +736
Gender: Masculino
Tibia Character: Marley

Tópico movido para dúvidas / pedidos resolvidos.
info
Group: Administrador
Joined: 26/02/07
Posts: 254
Reputation: +205
Gender: Masculino
Tibia Character: Frenvius

info
Group: Infante
Joined: 28/01/12
Posts: 1.6k
Reputation: +262
Gender: Masculino
Alguem poderia colocar para nçao usar esse comando com FIGHT.
function onSay(cid, words, param) local storage = 23564 local tempo = 30 if exhaustion.check(cid, storage) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar esse comando novamente.") return true end pos = {x=1023, y=1016, z=6} doSendMagicEffect(getPlayerPosition(cid),19) doPlayerSendCancel(cid,"Teleportado!") doTeleportThing(cid,pos) exhaustion.set(cid, storage, tempo*60) return true end