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.
Por FlamesAdmin, 12 de jul. de 2015 em 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
Grupo: Campones
Registrado: 14/10/13
Posts: 55
Reputação: +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
Grupo: Infante
Registrado: 22/12/12
Posts: 2k
Reputação: +736
Gênero: Masculino
Char no Tibia: Marley

Tópico movido para dúvidas / pedidos resolvidos.
info
Grupo: Administrador
Registrado: 26/02/07
Posts: 254
Reputação: +205
Gênero: Masculino
Char no Tibia: Frenvius

info
Grupo: Infante
Registrado: 28/01/12
Posts: 1.6k
Reputação: +262
Gênero: 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