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

Remove Storage Value After 30 days

potinho

Advanced OT User
Joined
Oct 11, 2009
Messages
1,403
Solutions
17
Reaction score
151
Location
Brazil
Hiho everybody, im hosting a 7.6 server (TFS 0.4) and have a action for vip scroll (its working), but VIP stays forever, i need when a player use the vip scroll, keep storage 30009 for 30 days, after this time remove. Following my LUA archive for vip:

Lua:
function onUse(cid, item, frompos, item2, topos)
    if item2.itemid == 2239 then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Parabens, voce se tornou um membro VIP do ExtremeOT por 30 dias!")
        setPlayerStorageValue(cid, 30009, 1)
        doPlayerAddPremiumDays(cid, 7)
        doRemoveItem(item.uid, 1)
    end

    return true
end
 
It doesn't count in the database?

Because if you already have a script, such as a movement that uses the storage, you'll need to exchange it for:
to >= os.time() (if player have the storage), when use getStorage
or < os.time() (if player doesn't have the storage)
 
Last edited:
It doesn't count in the database?

Because if you already have a script, such as a movement that uses the storage, you'll need to exchange it for:
to >= os.time() (if player have the storage), when use getStorage
or < os.time() (if player doesn't have the storage)
dont count in db, look in phpmyadmin, and when change, dont allow enter in portal who have the storage (30009) to enter
 
I guess worked, set a value '1597524964'. Thanks bro.
Post automatically merged:

But you've changed the movement script too?
The correct one to work with os.time () would be:

Lua:
if getPlayerStorageValue(cid, 30009) >= os.time() then


I guess worked, set a value '1597524964'. Thanks bro.
 
Back
Top