Ir para conteúdo
  • 0

[Ajuda] Talkaction So Pega Com Player Na Tela


Pergunta

Este script funciona perfeitamente, era uma actions e deixei assim, ta otimo, mas eu queria que ele funcionase apenas com o player que da infomação na tela

 

ele funciona assim

!pinfo fulano.

e mostra alguns dados do jogador informado.

 

20:11 /pinfo Trunks Af

20:11 Nick: Trunks Af

20:11 Level: 7

20:11 Magic Attack: 1

20:11 Hp: 745/745

20:11 Ki Points: 715/715

 

Mas como eu citei antes, quero que o jogador que eu queira saber a infomação, esteja pelo menos a 6 tiles de mim.

tentei usar

getDistanceToCreature(cid)

Mas nao funfa

script completo abaixo.

 

function onSay(cid, words, param, channel)
if getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then
return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR , "Voce nao pode estar em Batlel!")
end
if(param == '') then
 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
 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, "Player " .. param .. " not found.")
 return true
end
player1 = getPlayerByNameWildcard(param)
lol = getPlayerByNameWildcard(param)
local nick = getCreatureName(pid)
local ki = getPlayerMagLevel(pid)
local lvl = getPlayerLevel(pid)
local mana = getCreatureMana(pid)
local hp = getCreatureHealth(pid)
local maxmana = getCreatureMaxMana(pid)
local maxhp = getCreatureMaxHealth(pid)
local access = getPlayerAccess(pid)
if getPlayerByNameWildcard(param) ~= 1 then
doPlayerSendTextMessage(cid, 6, 'Nick: '..nick..'')
doPlayerSendTextMessage(cid, 19, 'Level: '..lvl..'')
doPlayerSendTextMessage(cid, 1, 'Magic Attack: '..ki..'')
doPlayerSendTextMessage(cid, 4, 'Hp: '..hp..'/'..maxhp..'')
doPlayerSendTextMessage(cid, 5, 'Ki Points: '..mana..'/'..maxmana..'')

else
doPlayerSendCancel(cid,"You can scout only players.")
end
return 1
end

Editado por CoyoteStark
Link para o comentário
https://xtibia.com/forum/topic/186180-ajuda-talkaction-so-pega-com-player-na-tela/
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

  • 0

Nao testei, tenta ae:

 

 

 

function onSay(cid, words, param, channel)

local tmf = getCreaturePosition(cid)

local tms = getCreaturePosition(pid)

if getDistanceBetween(tmf, tms) >= 7 then

return true

end

if getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then

return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR , "Voce nao pode estar em Batlel!")

end

if(param == '') then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")

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, "Player " .. param .. " not found.")

return true

end

player1 = getPlayerByNameWildcard(param)

lol = getPlayerByNameWildcard(param)

local nick = getCreatureName(pid)

local ki = getPlayerMagLevel(pid)

local lvl = getPlayerLevel(pid)

local mana = getCreatureMana(pid)

local hp = getCreatureHealth(pid)

local maxmana = getCreatureMaxMana(pid)

local maxhp = getCreatureMaxHealth(pid)

local access = getPlayerAccess(pid)

if getPlayerByNameWildcard(param) ~= 1 then

doPlayerSendTextMessage(cid, 6, 'Nick: '..nick..'')

doPlayerSendTextMessage(cid, 19, 'Level: '..lvl..'')

doPlayerSendTextMessage(cid, 1, 'Magic Attack: '..ki..'')

doPlayerSendTextMessage(cid, 4, 'Hp: '..hp..'/'..maxhp..'')

doPlayerSendTextMessage(cid, 5, 'Ki Points: '..mana..'/'..maxmana..'')

 

else

doPlayerSendCancel(cid,"You can scout only players.")

end

return 1

end

Link para o comentário
https://xtibia.com/forum/topic/186180-ajuda-talkaction-so-pega-com-player-na-tela/#findComment-1260133
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...