Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- addCommandHandler("qkx.vip",function(plr,cmd,cel,dni)
- if exports['pystories-admin']:getAdmin(plr,3) or exports['pystories-admin']:getAdmin(plr,4) then
- if not cel then outputChatBox("/dajvipa [gracz] [dni]",plr) return end
- if not dni then outputChatBox("/dajvipa [gracz] [dni]",plr) return end
- if not tonumber(dni) then outputChatBox("/dajvipa [gracz] [dni]",plr) return end
- local target=exports["pystories-core"]:findPlayer(plr,cel)
- if not target then
- outputChatBox("* Nie znaleziono podanego gracza.", plr, 255, 0, 0)
- return
- end
- setPremiumDay(target,dni)
- outputChatBox("Nadano konto premium na "..dni.." dni dla "..getPlayerName(target):gsub("#%x%x%x%x%x%x",""), plr)
- outputChatBox("Otrzymales konto premium na "..dni.." dni od "..getPlayerName(plr):gsub("#%x%x%x%x%x%x",""), target)
- triggerEvent("save:player",root,target)
- triggerEvent("load:player",root,target)
- setElementData(target,"player:premium",true)
- end
- end)
- function getPremiumDate(plr)
- local queryA=exports['pystories-db']:dbGet("SELECT * FROM pystories_users WHERE id=? AND premiumdate>NOW() LIMIT 1", getElementData(plr,"player:uid"))
- if (queryA and #queryA > 0) then
- return queryA[1].premiumdate
- end
- return false
- end
- function setPremiumDay(plr,days)
- if getPremiumDate(plr) then
- local queryA=exports['pystories-db']:dbSet(string.format("UPDATE ogrpg_users SET premiumdate = DATE(premiumdate) + INTERVAL %d DAY WHERE id=%d",days,getElementData(plr,"player:uid")))
- return end
- local queryA=exports['pystories-db']:dbSet(string.format("UPDATE ogrpg_users SET premiumdate = DATE(curdate()) + INTERVAL %d DAY WHERE id=%d",days,getElementData(plr,"player:uid")))
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement