Crie um arquivo em talkactions>scripts chamando vida.lua e cole isto dentro:
local minlevel = 10 -- minimo level para usar o comando
function onSay(cid, words, param)
if getPlayerLevel(cid) >= minlevel then
doSendMagicEffect(getCreaturePosition(cid), 14)
doPlayerSendTextMessage(cid, 24,"Você tem ".. getPlayerHealth(cid) .." no momento.")
doPlayerSendTextMessage(cid,22,"Você tem ".. getCreatureMaxHealth(cid) .. " ao total.")
else
doPlayerSendCancel(cid,"Você não tem o level necessário para usar este comando.")
end
return true
end
Em talkactions.xml coloque a tag:
<talkaction words="!vida" event="script" value="vida.lua"/>
Vá para a pasta lib e adicione isso em 050-function.lua lá no final:
function getPlayerHealth(cid) -- by vodka
doPlayerSave(cid)
local PlayerInfo = db.getResult("SELECT `health` FROM `players` WHERE `id` = " .. getPlayerGUID(cid))
return PlayerInfo:getDataInt("health")
end
(Crédito da função - Vodkart)
Vlw, abraço!