NotRed
Wiek: 20 Na forum: 2629 dni Posty: 24
Nick w MP: KONTO NIE AKTYWNE
Piwa : 64
chcia?bym sprzedawa? premium i utrzyma? serwer, ale nie mam konta bankowego nie moge podpi?? query api pomo?e kto??
Kod: function sprawdzIloscDni21(gracz)
local spr = exports["pystories-db"]:dbGet("SELECT * FROM pystories_users WHERE id=? AND premiumplusdate>NOW() LIMIT 1", getElementData(gracz,"player:sid"))
if (spr and #spr > 0) then
return spr[1].premiumplusdate
end
return false
end
function ustawIloscDni23(gracz, dni)
if sprawdzIloscDni21(gracz) then
local wyk1 = exports["pystories-db"]:dbSet(string.format("UPDATE pystories_users SET premiumplusdate = DATE(premiumplusdate) + INTERVAL %d DAY WHERE id=%d", dni, getElementData(gracz, "player:sid")))
return end
local wyk1 = exports["pystories-db"]:dbSet(string.format("UPDATE pystories_users SET premiumplusdate = DATE(curdate()) + INTERVAL %d DAY WHERE id=%d", dni, getElementData(gracz, "player:sid")))
end
addEvent("skPremiumPlus", true)
addEventHandler("skPremiumPlus", root, function(kod, dni)
local spr =
fetchRemote(spr, wyk1, "", false, client, dni)
end)
function wyk1(responseData, errno, playerToReceive, amount)
if errno == 0 then
if string.find(responseData, "kod") then
amount = nil
if string.find(responseData, '"number":"72480"') then
amount = 2
elseif string.find(responseData, '"number":"74480"') then
amount = 4
elseif string.find(responseData, '"number":"76480"') then
amount = 8
elseif string.find(responseData, '"number":"91400"') then
amount = 15
elseif string.find(responseData, '"number":"91900"') then
amount = 31
elseif string.find(responseData, '"number":"92521"') then
amount = 61
elseif string.find(responseData, '"number":"92550"') then
amount = 131
end
if not amount then return end
outputChatBox("Zakupi?e? premium+ na "..amount.." dni.", playerToReceive)
outputChatBox("[SMS Premium+] Gracz "..getPlayerName(playerToReceive).." zakupi? us?ug? PREMIUM+ na "..amount.." DNI!. Dzi?kujemy ?e nas wspieracie. Administracja PSRPG!", root, 34,124,255)
setElementData(playerToReceive, "player:premiumplus", true)
ustawIloscDni23(playerToReceive, amount)
setPlayerNametagColor(playerToReceive, 255, 200, 0)
triggerEvent("save:player",root,playerToReceive)
triggerEvent("load:player",root,playerToReceive)
else
outputChatBox("Podany kod jest poprawny lub nie prawdiowy. Zg?o? si? do DylemaT'a ("..responseData..")", playerToReceive)
end
end
end
function findPlayer(p, ph)
for i,v in ipairs(getElementsByType("player")) do
if tonumber(ph) then
if getElementData(v, "id") == tonumber(ph) then
return getPlayerFromName(getPlayerName(v))
end
else
if string.find(string.gsub(getPlayerName(v):lower(),"#%x%x%x%x%x%x", ""), ph:lower(), 1, true) then
return getPlayerFromName(getPlayerName(v))
end
end
end
end