Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local cfg = {
- daysAgo = 4, -- Quantos dias antes da estréia
- vipDaysCount = 7, -- Dias Vips que ganhará
- }
- function onLogin(cid)
- accID = getPlayerAccountId(cid)
- dbinfo = db.getResult("SELECT `id`, `name`, `group_id`, `created`, `vip_time` FROM `accounts` WHERE `id` = '"..accID.."';")
- if dbinfo:getID() ~= -1 then
- vip = dbinfo:getDataInt("vip_time")
- if vip < 1 then
- data = dbinfo:getDataInt("created")
- diff = (os.difftime(os.time(), data) / 60 / 60 / 24)
- if diff >= cfg.daysAgo then
- vip.addVipByAccount(getPlayerAccount(getPlayerByName(name)), vip.getDays(cfg.vipDaysCount))
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulations, you have received "..cfg.vipDaysCount.." vip days for create your account before the open server.")
- end
- end
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment