Ir para conteúdo

(Resolvido)[AJUDA] Sistema de checar a life do personagem !life

Featured Replies

Postado

Fiz para mostrar exatamente como vc disse lá em cima. Assim deve funcionar:

 

lifeP.lua (data/talkactions/scripts):

function onSay(cid, words, param, channel)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Life ["..getPlayerHealth(cid).."] - ["..getPlayerMaxHealth(cid).."]")
return true
end

Tag em talkactions.xml:

	<talkaction words="!life;/life" event="script" value="lifeP.lua"/>

Te ajudei?? REP + e ficamos quites... <ahttp://www.tibiaking.com/forum/uploads/emoticons/default_happyy.png' alt=';D'>

Atenciosamente,

Daniel.

Abraços!

  • Respostas 15
  • Visualizações 782
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Tenta assim: function onSay(cid, words, param, channel) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Life ["..tonumber(getPlayerHealth(cid)).."] - ["..tonumber(getPlayerMaxHealth(cid))

  • Tente esse: function onSay(cid, words, param, channel) local pid = getPlayerByNameWildcard(param) if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) the

  • enttao so usar esse: o de cima editado function onSay(cid, words, param, channel) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Life ["..getCreatureHealth(cid).."] - ["..getCreatureMax

Postado
  • Autor

Man nn pegou nn olha oq ta dando:

 

[Error - TalkAction Interface]
data/talkactions/scripts/lifeP.lua:onSay
Description:
data/talkactions/scripts/lifeP.lua:2: attempt to call global 'getPlayerHealth' (a nil value)
stack traceback:
        data/talkactions/scripts/lifeP.lua:2: in function <data/talkactions/scripts/lifeP.lua:1>

Postado

Tenta assim:

function onSay(cid, words, param, channel)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Life ["..tonumber(getPlayerHealth(cid)).."] - ["..tonumber(getPlayerMaxHealth(cid)).."]"
return true
end

Te ajudei?? REP + e ficamos quites... <ahttp://www.tibiaking.com/forum/uploads/emoticons/default_happyy.png' alt=';D'>

Atenciosamente,

Daniel.

Abraços!

Postado
  • Autor

Ainda nn deu man olha:

 

[Error - TalkAction Interface]
data/talkactions/scripts/lifeP.lua:onSay
Description:
data/talkactions/scripts/lifeP.lua:2: attempt to call global 'getPlayerHealth' (
a nil value)
stack traceback:
        data/talkactions/scripts/lifeP.lua:2: in function <data/talkactions/scri
pts/lifeP.lua:1>
[Error - LuaScriptInterface::loadFile] data/talkactions/scripts/lifeP.lua:3: ')'
 expected (to close '(' at line 2) near 'return'
[Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/lifeP
.lua)
data/talkactions/scripts/lifeP.lua:3: ')' expected (to close '(' at line 2) near
 'return'
Postado

Tente esse:

function onSay(cid, words, param, channel)
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
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Life ["..getCreatureHealth(pid).."] ["..getCreatureMaxHealth(pid).."]")
return true
end

ou esse

function onSay(cid, words, param, channel)
local pid = getPlayerByNameWildcard(param)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Life ["..getCreatureHealth(pid).."] - ["..getCreatureMaxHealth(pid).."]")
return true
end

Editado por narazaky (veja o histórico de edições)

Te ajudei? Então Rep + ;)

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo