LO

[Pedido] Script Status

Por lokitobr12, 26 de abr. de 2012 em Scripts

otserv
tibia
script
14
4.1k
lokitobr12L
26 de abril de 2012 às 10:46

Bom gente... Eu queria pedir um script que fosse assim !status me, ou !me, para informar, o level, a mana, o HP, dinheiro e outras coisas se tiver da pessoa...

 

É bem simples, mas eu não sei mexer muito com scripts, então nem sei fazer!

 

 

TFS 0.4

8.6

 

 

Eu ja vi um script assim pelo xtibia, mas deu erro no meu server e tive que reseta-lo... Por favor façam um sem erros :s Obrigado!

 

 

REP+

jhon992J
26 de abril de 2012 às 11:21

no proprio tfs jah possui esse script:

 

em talkactions/script/playerinfo.lua

function onSay(cid, words, param, channel)
   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

   local tmp = {accountId = getPlayerAccountId(pid), ip = getPlayerIp(pid)}
   local pos = getCreaturePosition(pid)
   doPlayerPopupFYI(cid, "Information about player" ..
       "\nName: " .. getCreatureName(pid) ..
       "\nGUID: " .. getPlayerGUID(pid) ..
       "\nGroup: " .. getPlayerGroupName(pid) ..
       "\nAccess: " .. getPlayerAccess(pid) ..
       "\nVocation: " .. getVocationInfo(getPlayerVocation(pid)).name ..
       "\nStatus:" ..
           "\nLevel - " .. getPlayerLevel(pid) .. ", Magic Level - " .. getPlayerMagLevel(pid) .. ", Speed - " .. getCreatureSpeed(pid) ..
           "\nHealth - " .. getCreatureHealth(pid) .. " / " .. getCreatureMaxHealth(pid) .. ", Mana - " .. getCreatureMana(pid) .. " / " .. getCreatureMaxMana(pid) ..
           "\nSkills:" ..
           "\nFist - " .. getPlayerSkillLevel(pid, SKILL_FIST) .. ", Club - " .. getPlayerSkillLevel(pid, SKILL_CLUB) .. ", Sword - " .. getPlayerSkillLevel(pid, SKILL_SWORD) .. ", Axe - " .. getPlayerSkillLevel(pid, SKILL_AXE) ..
           "\nDistance - " .. getPlayerSkillLevel(pid, SKILL_DISTANCE) .. ", Shielding - " .. getPlayerSkillLevel(pid, SKILL_SHIELD) .. ", Fishing - " .. getPlayerSkillLevel(pid, SKILL_FISHING) ..
       "\nCash:" ..
           "\nCrystal - " .. getPlayerItemCount(pid, 2160) .. ", Platinum - " .. getPlayerItemCount(pid, 2152) .. ", Gold - " .. getPlayerItemCount(pid, 2148) ..
           "\nBalance: " .. getPlayerBalance(pid) ..
           "\nPosition: [X - " .. pos.x .. " | Y - " .. pos.y .. " | Z - " .. pos.z .. "]" ..
       "\n\nInformation about account" ..
       "\nName: " .. getPlayerAccount(pid) ..
       "\nID: " .. tmp.accountId ..
       "\nNotations: " .. getNotationsCount(tmp.accountId) ..
       "\nIP: " .. doConvertIntegerToIp(tmp.ip) .. " (" .. tmp.ip .. ")")
   return true
end

 

e no talkactions.xml jah deve ter essa tag:

<talkaction log="yes" words="/info" access="2" event="script" value="playerinfo.lua"/>

é sóh você mudar para:

<talkaction log="yes" words="!status" event="script" value="playerinfo.lua"/>

lokitobr12L
26 de abril de 2012 às 11:28

Seguinte erro:

[26/04/2012 11:28:22] [Error - TalkAction Interface]

[26/04/2012 11:28:22] data/talkactions/scripts/playerinfo.lua:onSay

[26/04/2012 11:28:23] Description:

[26/04/2012 11:28:23] data/talkactions/scripts/playerinfo.lua:23: attempt to call global 'getCreatureHealth' (a nil value)

[26/04/2012 11:28:23] stack traceback:

[26/04/2012 11:28:23] data/talkactions/scripts/playerinfo.lua:23: in function <data/talkactions/scripts/playerinfo.lua:1>

jhon992J
26 de abril de 2012 às 12:29

Aqui funcionou perfeitamente. Esse erro que acusa ta dizendo que não existe a função getCreatureHealth no seu otserv.

lokitobr12L
26 de abril de 2012 às 18:24

Ta e como eu arrumo? .-.

jhon992J
26 de abril de 2012 às 18:46

acho que sóh implementando essa função nas suas sources ou na sua lib, mais nem sei fazer isso.

tbm acho que a compilação do teu tfs deve estar com problema se essa função não funciona, tenta substituir seu executavel por um outro.

VodkartV
26 de abril de 2012 às 19:01

fiz a função para você, no meu ot tbm não tinha ela :p

 

e lib/050-function adicione:

 

function getPlayerHealth(cid)
doPlayerSave(cid)
local PlayerInfo = db.getResult("SELECT `health` FROM `players` WHERE `id` = " .. getPlayerGUID(cid))
return PlayerInfo:getDataInt("health")
end

 

 

ai no script do jhon troque:

 

getCreatureHealth(pid)

 

por

 

getPlayerHealth(pid)

 

abraços

Editado Abril 27 por Vodkart

lokitobr12L
26 de abril de 2012 às 19:41

Deu Valew!

 

 

@EDIT1: REP So amanhã :s

Editado Abril 26 por lokitobr12

VodkartV
26 de abril de 2012 às 19:46

Deu Valew!

 

 

@EDIT1: REP So amanhã :s

que bom que deu certo, não se preocupe com rep.

Até

PsyMcKenzieP
26 de abril de 2012 às 20:02

Amigo poderia visitar esses tópicos e ver se consegue

me ajudar?

 

http://www.xtibia.com/forum/topic/185060-duvida-script-mkalo/page__fromsearch__1

 

http://www.xtibia.com/forum/topic/184816-script-reino/page__fromsearch__1

 

Muito Obrigado pela atenção Vodkart,

e desculpe o Incomodo.

Abraços!!

VildenV
27 de abril de 2012 às 00:52

Dúvida sanada, tópico movido.

JeanCristianJ
28 de abril de 2012 às 14:05

olha o vodkart ajudando pensei que tinha desistido ainda bem que nao (y)

VildenV
28 de abril de 2012 às 14:11

Comentário desnecessário, rep-

8 anos depois...
fluhrF
27 de junho de 2020 às 07:07

ola bom dia, alguem poderia me ajudar copiei os script e fiz tudo certo, porem na hora que falo !status no jogo aparece essa mensagem "Command param required."