When using "doPlayerSetSpecialDescription" - can you only use it once? Because it seems like if I have multiple onLook scripts that set a special description - only the last one loaded will set the description. My work around right now has been to convert all seperate onLook scripts into a merged script like presented below; but I just wanted to ask, is there a way to load multiple specialDescriptions/onLook scripts in 0.4? For example, one for VIP Check; one for Frag Check; one for Guild Information.
Code:
function onLook(cid, thing, position, lookDistance)
function getDeathsAndKills(cid, type) -- by vodka
local query,d = db.getResult("SELECT `player_id` FROM "..(tostring(type) == "kill" and "`player_killers`" or "`player_deaths`").." WHERE `player_id` = "..getPlayerGUID(cid)),0
if (query:getID() ~= -1) then
repeat
d = d+1
until not query:next()
query:free()
end
return d
end
if isPlayer(thing.uid) then
-- Yes Guild/Yes VIP
if getPlayerGuildId(thing.uid) > 0 and getPlayerVipDays(cid) >= 1 then
doPlayerSetSpecialDescription(thing.uid, " [VIP Player]. Guild has " .. #getGuildMembers(getPlayerGuildId(thing.uid)) .. " members, and " .. #getGuildMembersOnline(getPlayerGuildId(thing.uid)) .. " of them online. [Kills: ("..getDeathsAndKills(thing.uid, "kill")..") / Deaths: ("..getDeathsAndKills(thing.uid, "death")..")]")
-- No Guild/Yes VIP
elseif getPlayerGuildId(thing.uid) == 0 and getPlayerVipDays(cid) >= 1 then
doPlayerSetSpecialDescription(thing.uid, " [VIP Player]. [Kills: ("..getDeathsAndKills(thing.uid, "kill")..") / Deaths: ("..getDeathsAndKills(thing.uid, "death")..")]")
-- Yes Guild/No VIP
elseif getPlayerGuildId(thing.uid) > 0 and getPlayerVipDays(cid) <= 1 then
doPlayerSetSpecialDescription(thing.uid, " [Non-VIP]. Guild has " .. #getGuildMembers(getPlayerGuildId(thing.uid)) .. " members, and " .. #getGuildMembersOnline(getPlayerGuildId(thing.uid)) .. " of them online. [Kills: ("..getDeathsAndKills(thing.uid, "kill")..") / Deaths: ("..getDeathsAndKills(thing.uid, "death")..")]")
-- No Guild/No VIP
elseif getPlayerGuildId(thing.uid) == 0 and getPlayerVipDays(cid) <= 1 then
doPlayerSetSpecialDescription(thing.uid, " [Non-VIP]. [Kills: ("..getDeathsAndKills(thing.uid, "kill")..") / Deaths: ("..getDeathsAndKills(thing.uid, "death")..")]")
end
end
return true
end