Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local vocs = {
- [12] = 4,
- [11] = 3,
- [10] = 2,
- [9] = 1,
- }
- function CheckREMOVERVIP(cid)
- local ostime = getPlayerStorageValue(cid, 29000)
- if (ostime > 0) then
- if (os.time() >= ostime) then
- if (vocs[getPlayerVocation(cid)]) then
- doPlayerSetVocation(cid, vocs[getPlayerVocation(cid)])
- end
- db.executeQuery("DELETE FROM `player_storage` WHERE `player_id` = ".. getPlayerAccount(cid) .." AND `key` = 29000;")
- doPlayerSendTextMessage(cid, 27, "Seus dias de VIP acabaram.")
- doPlayerSetVocation(cid, vocs[getPlayerVocation(cid)])
- doPlayerSetGroupId(cid, 1)
- else
- if (os.time() > 1) and (not vocs[getPlayerVocation(cid)]) then
- for i, v in pairs(vocs) do
- if (v == getPlayerVocation(cid)) then
- doPlayerSetVocation(cid, i)
- break
- end
- end
- end
- registerCreatureEvent(cid, "VipCheckL")
- end
- end
- end
- function onLogin(cid)
- setPlayerStorageValue(cid, 29000, 1)
- CheckREMOVERVIP(cid)
- return true
- end
- function onLogout(cid)
- CheckREMOVERVIP(cid)
- return true
- end
Add Comment
Please, Sign In to add comment