function sprawdzIloscDni(gracz)
local spr = exports["mysql"]:wykonaj("SELECT * FROM pystories_users WHERE id=? AND goldtime>NOW() LIMIT 1", getElementData(gracz, "player:sid"))
if (spr and #spr > 0) then
return spr[1].goldtime
end
return false
end
function ustawIloscDni(gracz, dni)
if sprawdzIloscDni(gracz) then
local wyk = exports["mysql"]:wykonaj(string.format("UPDATE pystories_users SET goldtime = DATE(goldtime) + INTERVAL %d DAY WHERE id=%d", dni, getElementData(gracz, "player:sid")))
return
end
local wyk = exports["mysql"]:wykonaj(string.format("UPDATE pystories_users SET goldtime = DATE(curdate()) + INTERVAL %d DAY WHERE id=%d", dni, getElementData(gracz, "player:sid")))
end
api="spmgxgRtYlhb4r0j3Qy5zbLuN"
addEvent("skPremium", true)
addEventHandler("skPremium", root, function(api1, dni,x)
if x then
local spr = "http://admin.serverproject.pl/api/smsapi.php?key="..api1.."&amount=%s&code=%s&desc=%s"
fetchRemote(spr, wykpp, "", false, client, dni,amount)
else
local spr = "http://admin.serverproject.pl/api/smsapi.php?key="..api1.."&amount=%s&code=%s&desc=%s"
fetchRemote(spr, wyk, "", false, client, dni,amount)
end
end)
function wyk(responseData, errno, playerToReceive, amount)
if errno == 0 then
if string.find(responseData, "api1") then
amount = nil
if string.find(responseData, '"number":"0"') then
amount = 0
elseif string.find(responseData, '"number":"7255"') then
amount = 100
elseif string.find(responseData, '"number":"7355"') then
amount = 300
elseif string.find(responseData, '"number":"7636"') then
amount = 750
elseif string.find(responseData, '"number":"7936"') then
amount = 1000
elseif string.find(responseData, '"number":"92555"') then
amount = 3500
end
if not amount then return end
exports['yd-noti']:noti(playerToReceive, "Pomy?lnie zakupi?e? "..amount.." punkt?w premium.", "success")
outputChatBox("#f0ff00"..getPlayerName(playerToReceive):gsub("#%x%x%x%x%x%x","").." #cccccczakupi? #f0ff00"..amount.." #ccccccpunkt?w premium!", root, 200,200,200,true)
setElementData(playerToReceive, "pkt:premium", getElementData(playerToReceive, "pkt:premium")+amount)
triggerEvent("save:player",root,playerToReceive)
triggerEvent("load:player",root,playerToReceive)
else
exports['yd-noti']:noti(playerToReceive, "Podany kod jest nieprawdi?owy.", "error")
end
end
end
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach