• 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!

Vip ends but promotion keeps forever and I want to ends too

tev

Banned User
Joined
Apr 19, 2013
Messages
113
Reaction score
6
I need help guys, I this item that gives VIP and Promotion, but my vip ends and my promotion doesn't end. How can I solve this? I want to end the promotion.

Script:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)

local config={
removeOnUse = "yes" -- remover quando usar ("yes" or "no")
}

local days = 1 -- dias que serão adicionados
local daysvalue = days * 24 * 60 * 60
local storageplayer = getPlayerStorageValue(cid, 13540)
local timenow = os.time()

if getPlayerStorageValue(cid, 13540) - os.time() <= 0 then
time = timenow + daysvalue
else
time = storageplayer + daysvalue
end
if doPlayerSetPromotionLevel(cid, 2) == 1 or getPlayerVocation(cid) == 5 then
doPlayerSetVocation(cid, 9)
end

if doPlayerSetPromotionLevel(cid, 2) == 2 or getPlayerVocation(cid) == 6 then
doPlayerSetVocation(cid, 10)
end


if doPlayerSetPromotionLevel(cid, 2) == 3 or getPlayerVocation(cid) == 7 then
doPlayerSetVocation(cid, 11)
end

if doPlayerSetPromotionLevel(cid, 2) == 4 or getPlayerVocation(cid) == 8 then
doPlayerSetVocation(cid, 12)
end

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Foram adicionados ".. days .." dias de VIP no seu character.")
setPlayerStorageValue(cid, 13540, time)
local quantity = math.floor((getPlayerStorageValue(cid, 13540) - timenow)/(24 * 60 * 60))
doSendMagicEffect(getPlayerPosition(cid), math.random(28,30))
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.")
if (config.removeOnUse == "yes") then
doRemoveItem(item.uid, 1)
end

return TRUE
end

Heeelp :(
 
so how ur vip works? anyways add some loginevent to remove it when ur (storage - os.time) <= 0
something like
Code:
function onLogin(cid)
    if getPlayerStorageValue(cid, 13540) - os.time() <= 0 then
        doPlayerSetVocation(cid, (getPlayerVocation(cid) - 4))
    end
    return true --*****
end
idk
 
Code:
doPlayerSetPromotionLevel(cid, 2) == 4

You can remove those, just use
Code:
if(doPlayerSetPromotionLevel(cid, 2) and ...) then
 
Back
Top