SO

Função Que Retorna Cor Do Char

Por Sofft, 22 de abr. de 2012 em Scripts

cor
função
char
ot
retorno
lua
otserv
tibia
5
1.6k
SofftS
22 de abril de 2012 às 09:20

Xtibianos, queria saber se há uma função que me retorne a cor do char, e se houver qual a sua sintaxe.

 

Ex: getPlayerColor(cid,detail)

 

desde já, Obrigado!

bonazzaB
22 de abril de 2012 às 10:13

use getCreatureOutfit(cid).

 

por exemplo se vc quer pegar a cor da cabeça vc usaria

 

getCreatureOutfit(cid).lookHead

 

aqui uma função para você:

 

function getOutfitColor(cid)
o = getCreatureOutfit(cid)
local str,color = "",{["Head"] = o.lookHead,["Body"] = o.lookBody,["Legs"] = o.lookLegs,["Feet"] = o.lookFeet} 
for i,x in pairs(color) do 
str = str.."\n ".. i .. " [".. x .. "]\n"
end
return doPlayerPopupFYI(cid, str)
end

SofftS
22 de abril de 2012 às 10:35

@SrNight,

isso vai me retornar o valor da cor?

bonazzaB
22 de abril de 2012 às 10:53

@SrNight,

isso vai me retornar o valor da cor?

exatamente, exemplo em uma talkaction:

 

function onSay(cid, words, param, channel)  
return getOutfitColor(cid)
end 

 

0LlvF.png

Editado Abril 22 por SrNight

SofftS
22 de abril de 2012 às 11:12

Certinho, Obrigado, rep+