UP!
18
pedido
1 - Comando pra ver informaçoes do char | 2 - look
Por 180319mu, 11 de fev. de 2013 em Scripts
look
comando
talkaction
resolvido
script
5
1.5k
14 de fevereiro de 2013 às 18:40
14 de fevereiro de 2013 às 20:19
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")
14 de fevereiro de 2013 às 21:31
funfou certinho, valeu.
só não te do o rep + agora porque ja te dei hoje
podem mover o topico
info
Grupo: Infante
Registrado: 13/10/08
Posts: 1.6k
Reputação: +420
Char no Tibia: Demonbholder

14 de fevereiro de 2013 às 21:33
Tópico movido para a seção de dúvidas e pedidos resolvidos.




info
Grupo: Campones
Registrado: 02/12/09
Posts: 31
Reputação: 0
Char no Tibia: Noope
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..