Sim e pra usar é !vida
info
Grupo: Conde
Registrado: 29/04/09
Posts: 904
Reputação: +389
Char no Tibia: Jabuti Selvagem

info
Grupo: Barão
Registrado: 30/01/14
Posts: 201
Reputação: +12
Char no Tibia: Xtibia Infer

n da nenhum erro e tmbm n funciona, meu servidor é o radbr-fenix
info
Grupo: Barão
Registrado: 30/01/14
Posts: 201
Reputação: +12
Char no Tibia: Xtibia Infer

@up alguem pode me ajudar?
Pelo que vi ali em cima, seu servidor não tem a função getCreatureHealth(avá). O Vodkart disponibilizou uma função aqui no fórum com a mesma utilidade. Só você procurar, depois colocar em lib, e usar no código.
info
Grupo: Barão
Registrado: 30/01/14
Posts: 201
Reputação: +12
Char no Tibia: Xtibia Infer

tem como me passar o link?
function getPlayerHealth(cid) -- by vodka
doPlayerSave(cid)
local PlayerInfo = db.getResult("SELECT `health` FROM `players` WHERE `id` = " .. getPlayerGUID(cid))
return PlayerInfo:getDataInt("health")
end
info
Grupo: Campones
Registrado: 02/04/13
Posts: 83
Reputação: +41

Se for so a funçao getCreatureHealth que nao tem no seu server entao ta ai:
function getCreatureHealth(uid)
local result = db.getResult("SELECT health FROM players WHERE id = "..getPlayerGUID(uid).."")
return result:getDataString("health")
end
function onSay(cid, words, param, channel)
if param == "" then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Para saber a vida maxima de alguem diga !vida playername")
return true
end
if isPremium(cid) then
for _, tid in pairs(getPlayersOnline()) do
local pid = getPlayerByName(param)
if isInArray(tid, pid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nVida de [ " .. getCreatureName(pid) .. " ] atual: " .. getCreatureHealth(pid) ..
"\nVida de [ " .. getCreatureName(pid) .. " ] máxima: " .. getCreatureMaxHealth(pid) .. "")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O jogador " .. param .. " nao esta online ou nao existe")
end
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Apenas jogadores VIP podem utilizar este comando para visualizar informações de outros
jogadores.")
end
return true
end
info
Grupo: Conde
Registrado: 29/04/09
Posts: 904
Reputação: +389
Char no Tibia: Jabuti Selvagem

Pode usar assim:
function getPlayerHealth(cid) -- by vodka
doPlayerSave(cid)
local PlayerInfo = db.getResult("SELECT `health` FROM `players` WHERE `id` = " .. getPlayerGUID(cid))
return PlayerInfo:getDataInt("health")
end
function onSay(cid, words, param, channel)
if param == "" then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Para saber a vida de alguem diga !vida playername")
return true
end
if isPremium(cid) then
for _, tid in pairs(getPlayersOnline()) do
local pid = getPlayerByName(param)
if isInArray(tid, pid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nVida de [ " .. getCreatureName(pid) .. " ] atual: " .. getPlayerHealth(pid) .. "\nVida de [ " .. getCreatureName(pid) .. " ] máxima: " .. getCreatureMaxHealth(pid) .. "")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O jogador " .. param .. " nao esta online ou nao existe")
end
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Apenas jogadores VIP podem utilizar este comando para visualizar informações de outros jogadores.")
end
return true
end
Porém acho melhor resgistrar a função numa lib pq outros scripts podem precisar dela. Além disso, acho que seu server pode não ter a função getCreatureMaxHealth(cid) tbm... Vc vai ter que testar.
info
Grupo: Barão
Registrado: 30/01/14
Posts: 201
Reputação: +12
Char no Tibia: Xtibia Infer

Pode usar assim:
function getPlayerHealth(cid) -- by vodka doPlayerSave(cid) local PlayerInfo = db.getResult("SELECT `health` FROM `players` WHERE `id` = " .. getPlayerGUID(cid)) return PlayerInfo:getDataInt("health") end function onSay(cid, words, param, channel) if param == "" then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Para saber a vida de alguem diga !vida playername") return true end if isPremium(cid) then for _, tid in pairs(getPlayersOnline()) do local pid = getPlayerByName(param) if isInArray(tid, pid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nVida de [ " .. getCreatureName(pid) .. " ] atual: " .. getPlayerHealth(pid) .. "\nVida de [ " .. getCreatureName(pid) .. " ] máxima: " .. getCreatureMaxHealth(pid) .. "") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O jogador " .. param .. " nao esta online ou nao existe") end end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Apenas jogadores VIP podem utilizar este comando para visualizar informações de outros jogadores.") end return true endPorém acho melhor resgistrar a função numa lib pq outros scripts podem precisar dela. Além disso, acho que seu server pode não ter a função getCreatureMaxHealth(cid) tbm... Vc vai ter que testar.
tem como me encina como eu registro na lib?
info
Grupo: Conde
Registrado: 29/04/09
Posts: 904
Reputação: +389
Char no Tibia: Jabuti Selvagem

é só criar um arquivo creatureHealth.lua na pasta lib e colocar isso:
function getPlayerHealth(cid) -- by vodka
doPlayerSave(cid)
local PlayerInfo = db.getResult("SELECT `health` FROM `players` WHERE `id` = " .. getPlayerGUID(cid))
return PlayerInfo:getDataInt("health")
end
O script funcionou?
info
Grupo: Barão
Registrado: 30/01/14
Posts: 201
Reputação: +12
Char no Tibia: Xtibia Infer

vou testar qnd eu chegar em casa agr estou no meu trabalho aeuaueaueuaeuaeu!
info
Grupo: Conde
Registrado: 29/04/09
Posts: 904
Reputação: +389
Char no Tibia: Jabuti Selvagem

beleza ![]()
info
Grupo: Barão
Registrado: 30/01/14
Posts: 201
Reputação: +12
Char no Tibia: Xtibia Infer

deu serto podem fexa ake





info
Grupo: Barão
Registrado: 30/01/14
Posts: 201
Reputação: +12
Char no Tibia: Xtibia Infer
SO COLOKO ISSO NO SCRIPT?