kito2
www.masteria.net
I have this lua code, and it only works when you see other players... I need to make it works when you see your character too...
I figured to add this:
After:
But it doesn't work... Any idea?
PHP:
function onLook(cid, thing, position, lookDistance)
if(isPlayer(thing.uid)) then
local rank = {rank = "Private", frags = 0}
for k, v in pairs(titles) do
if(math.max(0, getPlayerStorageValue(thing.uid, fragsStorage)) > k - 1) then
if(k - 1 > rank.frags) then
rank.rank, rank.frags = v, k - 1
end
end
end
doPlayerSetSpecialDescription(thing.uid, "\n[Reborns: " .. getReborns(thing.uid) .."]\n Military Rank: " .. rank.rank)
end
return true
end
I figured to add this:
PHP:
for k, v in pairs(titles) do
if(math.max(0, getPlayerStorageValue(cid, fragsStorage)) > k - 1) then
if(k - 1 > rank.frags) then
rank.rank, rank.frags = v, k - 1
end
end
end
doPlayerSetSpecialDescription(cid, "\n[Reborns: " .. getReborns(cid) .."]\n Military Rank: " .. rank.rank)
After:
PHP:
doPlayerSetSpecialDescription(thing.uid, "\n[Reborns: " .. getReborns(thing.uid) .."]\n Military Rank: " .. rank.rank)
But it doesn't work... Any idea?