Hey there guys, running into a slight issue over the past few days. Don't get any errors and no matter if I use cid, thing.uid it still fails to check properly. I was originally using getPlayerVipDays(cid), but that wasn't working. So figured since my VIP system changes players from vocation 1-4, to 5-8 upon login if they are VIP; then I can just check the players vocation, and if its above 4; then they are VIP and if it's below then they arent. But everyone still shows "Non-VIP" even though they are vocation 5-8.
Example of player vocation 8, failing to show VIP:
[He is a VIP elite knight [Non-VIP]. Guild has 4 members, and 1 of them online. [Kills: (0) / Deaths: (3)].]
[Rev 0.4] [CreatureScript]
Anyone see what I did wrong or?
Example of player vocation 8, failing to show VIP:
[He is a VIP elite knight [Non-VIP]. Guild has 4 members, and 1 of them online. [Kills: (0) / Deaths: (3)].]
[Rev 0.4] [CreatureScript]
Lua:
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 [Vocation is greater than 4.]
if getPlayerGuildId(thing.uid) > 0 and getPlayerVocation(thing.uid) < 4 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 getPlayerVocation(thing.uid) < 4 then
doPlayerSetSpecialDescription(thing.uid, " [VIP Player]. [Kills: ("..getDeathsAndKills(thing.uid, "kill")..") / Deaths: ("..getDeathsAndKills(thing.uid, "death")..")]")
-- Yes Guild/No VIP [Vocation is less than 5.]
elseif getPlayerGuildId(thing.uid) > 0 and getPlayerVocation(thing.uid) > 5 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 getPlayerVocation(thing.uid) > 5 then
doPlayerSetSpecialDescription(thing.uid, " [Non-VIP]. [Kills: ("..getDeathsAndKills(thing.uid, "kill")..") / Deaths: ("..getDeathsAndKills(thing.uid, "death")..")]")
end
end
return true
end
Anyone see what I did wrong or?