O comando !vida do meu Servidor está bugado.
Olhei vários tópicos e não funfo, aparece esse erro :
Me ajuda porfavor.
O comando !vida do meu Servidor está bugado.
Olhei vários tópicos e não funfo, aparece esse erro :
Me ajuda porfavor.
Testei Aki Funcionou Normal A Script sem erro 8.6
function onSay(cid, words, param, channel)
if(param == '') thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nVida atual: " .. getCreatureHealth(cid) .. "\nVida maxima: " .. getCreatureMaxHealth(cid) .. "")return trueendif isPremium(cid) == TRUE thenlocal pid = getPlayerByNameWildcard(param)if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O jogador com o nome " .. param .. " nao esta online ou nao existe.")return trueenddoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nVida de [ " .. getCreatureName(pid) .. " ] atual: " .. getCreatureHealth(pid) .. "\nVida de [ " .. getCreatureName(pid) .. " ] maxima: " .. getCreatureMaxHealth(pid) .. "")return trueelsedoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Apenas jogadores VIP podem utilizar este comando para visualizar informacoes de outros jogadores.")return trueendend
<talkaction words="!vida" event="script" value="vida.lua"/>
Mesmo Erro:
[24/08/2013 19:34:47] [Error - TalkAction Interface]
Qual a versão utilizada?
8.60
tem como dar erro nao. se realmente for 8.60.
function onSay(cid, words, param) local hp = getCreatureHealth(cid) doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, "Voce tem "..hp.." health points.") return TRUE end
na boa , esta é a area errada , vc só fez o meu tópico desaparecer -.-
tem como dar erro nao. se realmente for 8.60.
function onSay(cid, words, param) local hp = getCreatureHealth(cid) doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, "Voce tem "..hp.." health points.") return TRUE end
Não pego Versão do Tfs 0.3.6
[24/08/2013 02:14:24] data/talkactions/scripts/vida.lua:3: attempt to call global 'getCreatureHealth' (a nil value)
O script tá concatenando de forma burra...
Essa é a linha do erro:
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nVida atual: " .. getCreatureHealth(cid) .. "\nVida máxima: " .. getCreatureMaxHealth(cid) .. "")
Mais exatamente aqui:
" .. getCreatureHealth(cid) .. "\nVida máxima: " .. getCreatureMaxHealth(cid) .. ""
Se ninguém conseguir resolver depois dessa dica eu vejo o que faço...
Abraços.
#Ciel, não tem nenhum erro de concatenação aí, apenas está dizendo que não encontra a função getCreatureHealth, que por sinal fica nas sources. Isso é bem estranho.
no meu server tbm não tinha essa função, tive que criar uma para quebrar o galho:
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) local param = param:lower() if param == '' then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nVida atual: " .. getPlayerHealth(cid) .. "\nVida máxima: " .. getCreatureMaxHealth(cid)) return true elseif not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Apenas jogadores VIP podem utilizar este comando para visualizar informações de outros jogadores.") return true end local pid = getPlayerByNameWildcard(param) if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O jogador com o nome " .. param .. " não esta online ou não existe.") return true end return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nVida de [ " .. getCreatureName(pid) .. " ] atual: " .. getPlayerHealth(pid) .. "\nVida de [ " .. getCreatureName(pid) .. " ] maxima: "..getCreatureMaxHealth(pid)) end
EDIT: Muito Obrigado Vodkart seu trabalho aqui no xtibia é muito bom, sempre quando preciso de alguma coisa sobre script você me ajuda Brigadão ae
Tópico movido para a seção de dúvidas e pedidos resolvidos.