FE
dúvida

Script !vida

Por felipeomatad, 23 de nov. de 2012 em Scripts

script
9
1.4k
23 de novembro de 2012 às 16:48

Alguen Pode Me ajuda meu script de vida do meu ot sever mapa radbr full não pega ja tentei varios scripts, mais nunca pego alguen pode me ajudar?

Yan OliveiraY
23 de novembro de 2012 às 16:55

Posta o script que não pego.

23 de novembro de 2012 às 17:05

Posta o script que não pego.

 

<talkaction words="!vida" event="script" value="vida.lua"/>

 

function onSay(cid, words, param, channel)

if(param == '') then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nVida atual: " .. getCreatureVida(cid) .. "\nVida máxima: " .. getCreatureMaxVida(cid) .. "")

return true

end

 

if isPremium(cid) == TRUE then

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, "\n de Vida[ " .. getCreatureName(pid) .. " ] atual: " .. getCreatureVida(pid) .. "\nVida de [ " .. getCreatureName(pid) .. " ] máxima: " .. getCreatureMaxVida(pid) .. "")

return true

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Apenas jogadores VIP podem utilizar este comando para visualizar informações de outros jogadores.")

return true

end

end

SkyLighS
23 de novembro de 2012 às 17:33

criei aki agr.

 

function onSay(cid, words, param)
function getCreatureHealth(cid)

doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Voce tem " .. getCreatureHealth(cid)
end

 

em talkactions.xml

 

<talkaction words="!Vida" script="nome do arquivo.lua"/>

Editado Novembro 23 por SkyLigh

23 de novembro de 2012 às 17:49

criei aki agr.

 

function onSay(cid, words, param)

doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Voce tem " .. getCreatureHealth(cid) .. " health points.")
end

 

em talkactions.xml

 

<talkaction words="!Vida" script="nome do arquivo.lua"/>

 

Não Funfo , Olha o Erro

 

[23/11/2012 17:48:43] [Error - TalkAction Interface]

[23/11/2012 17:48:43] data/talkactions/scripts/vida.lua:onSay

[23/11/2012 17:48:43] Description:

[23/11/2012 17:48:43] data/talkactions/scripts/vida.lua:3: attempt to call global 'getCreatureHealth' (a nil value)

[23/11/2012 17:48:43] stack traceback:

[23/11/2012 17:48:43] data/talkactions/scripts/vida.lua:3: in function <data/talkactions/scripts/vida.lua:1>

SkyLighS
23 de novembro de 2012 às 17:56

editei o script ver se vai.

Yan OliveiraY
23 de novembro de 2012 às 17:57

Tenta assim:

 

function onSay(cid, words, param)

doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "Voce tem " .. doPlayerAddHealth(cid, 2222) .. " health points.")
end

 

em talkactions.xml

 

<talkaction words="!Vida" script="nome do arquivo.lua"/>

 

Obs: Copiei do SkyLigh e editei.

SlicerS
23 de novembro de 2012 às 18:05

@sky

mano... por favor! teste as coisas antes de postar... teu script esta bem no sense... ;/

achu q ja eh a 10* vez q vejo vc postar scripts assim no sense... tenta usar o OTScript Live!, ele tem um debugger proprio, apertando F5, ajuda muito no inicio....

 

@topic

function onSay(cid, words, param) 
doPlayerSendTextMessage(cid, 20, "Voce tem " .. getCreatureHealth(cid) .. " / ".. getCreatureMaxHealth(cid).." health points.") 
return true
end

Editado Novembro 23 por Slicer

caoticC
23 de novembro de 2012 às 18:10

Skyligh como estagiário você sabe muito bem que scripts muito bugados(non - sense) são considerados flood.

Como o slicer disse debbuger são ótimos.

Recomendo Lua Demo