• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Promotion doll bug.

Status
Not open for further replies.

Ufonica

New Member
Joined
Aug 3, 2018
Messages
55
Reaction score
0
Hello guys so i am trying to make a promotion, everything works perfectly fine but when the player logs out they lose the promotion, can someone help me fix this.

"function onUse(cid, item, fromPosition, itemEx, toPosition)
local cfg = {
level = 1, --- level to use items
vocs = { 5, 6, 7, 8 }, --- put here vocation must use items
storage = 452473991 --- set any empty storage
}
if(getPlayerStorageValue(cid, cfg.storage) == -1) then
if(getPlayerLevel(cid) >= cfg.level) then
if(isInArray(cfg.vocs, getPlayerVocation(cid)) == true) then
setPlayerPromotionLevel(cid, getPlayerPromotionLevel(cid) + 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been promoted to " .. getVocationInfo(getPlayerVocation(cid)).name .. ".")
doSendMagicEffect(getCreaturePosition(cid), 55)
setPlayerStorageValue(cid, cfg.storage, 1)
doRemoveItem(item.uid, 1)

else
doCreatureSay(cid, "Only players with first promotion may get their Second promotion.", TALKTYPE_ORANGE_1)
end
else
doCreatureSay(cid, "Sorry, only characters of level " .. cfg.level .. " or above can buy Second Promotion.", TALKTYPE_ORANGE_1)
end
else
doCreatureSay(cid, "You have already purchased the Second Promotion.", TALKTYPE_ORANGE_1)
end
return
end
"
 
You can use the code tags (remove *s): [*CODE][*/CODE]

What does your setPlayerPromotionLevel() function do exactly? My initial guess is that either the new vocation isn't being saved to the database when the player logs out, or it's being overwritten when the player logs in.
 
Status
Not open for further replies.
Back
Top