Ir para conteúdo
  • 0

1 - Comando pra ver informaçoes do char | 2 - look


180319mu

Pergunta

bom, como no meu ot existe mana gem/hp gem, gostaria de um script que ao falar !charinfo,

aparecesse as seguintes informaçoes

HP Max

Mana Max

Level

 

~~

 

o segundo eu não sei se é um script, mas queria que ao dar look em um tutor, aparecesse

 

You see xxxxx He is a druid and Tutor..

Link para o comentário
Compartilhar em outros sites

4 respostass a esta questão

Posts Recomendados

  • 0

Primeiro (talkaction):

function onSay(cid, words, param, channel)
   if getPlayerByNameWildcard(param) ~= nil then
       cid = getPlayerByNameWildcard(param)
   end
   doPlayerPopupFYI(cid,"Informações do jogador: "..getCreatureName(cid).."\n - HP Max: "..getCreatureMaxHealth(cid).."\n - MP Max: "..getPlayerMaxMana(cid).."\n - Level: "..getPlayerLevel(cid))
   return true
end

 

Segundo: creaturescripts/scripts/look.lua:

function onLook(cid, thing, position, lookDistance)
function getArticle(str) return isInArray({"a","e","i","o","u"},string.sub(str,0,1)) and "an" or "a" end

   if isPlayer(thing.uid) and thing.uid ~= cid and getPlayerAccess(thing.uid) > 4 then
s = getPlayerSex(thing.uid)
       doPlayerSetSpecialDescription(thing.uid,'\n'..(s == 1 and "He" or "She")..' is '..getArticle(getPlayerVocationName(thing.uid))..' '..getPlayerVocationName(thing.uid)..'.')
       return true
   elseif thing.uid == cid then
if getPlayerAccess(cid) > 4 then
doPlayerSetSpecialDescription(thing.uid,'\nYou are '..getArticle(getPlayerVocationName(cid))..' '..getPlayerVocationName(cid)..'.')
end
       local string = 'You see yourself.'
       if getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION) then
           string = string..' You are '.. getPlayerGroupName(cid) ..'.'
       elseif getPlayerVocation(cid) ~= 0 then
           string = string..' You are '.. getPlayerVocationName(cid) ..'.'
       else
           string = string..' You have no vocation.'
       end
       string = string..getPlayerSpecialDescription(cid)..''

       if getPlayerNameByGUID(getPlayerPartner(cid), false, false) ~= nil then
           string = string..' You are '.. (getPlayerSex(cid) == 0 and 'wife' or 'husband') ..' of '.. getPlayerNameByGUID(getPlayerPartner(cid)) ..'.'
       end

       if getPlayerGuildId(cid) > 0 then 
           string = string..' You are ' .. (getPlayerGuildRank(cid) == '' and 'a member' or getPlayerGuildRank(cid)) ..' of the '.. getPlayerGuildName(cid)
           string = getPlayerGuildNick(cid) ~= '' and string..' ('.. getPlayerGuildNick(cid) ..').' or string..'.'
       end 

       if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS) then
           string = string..'\nHealth: ['.. getCreatureHealth(cid) ..' / '.. getCreatureMaxHealth(cid) ..'], Mana: ['.. getCreatureMana(cid) ..' / '.. getCreatureMaxMana(cid) ..'].'
           string = string..'\nIP: '.. doConvertIntegerToIp(getPlayerIp(cid)) ..'.'
       end

       if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION) then
           string = string..'\nPosition: [X:'.. position.x..'] [Y:'.. position.y..'] [Z:'.. position.z..'].'
       end
       doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string)  
       return false
   end
   return true
end

 

tag:

<event type="look" name="Look" event="script" value="look.lua"/>

 

adiciona essa linha no login.lua:

registerCreatureEvent(cid, "Look")

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...