Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2019-02-04, 14:49


killercycDDS

Migacz






Wiek: 26
Na forum: 4653 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1667

Respekt: 22

witam mam pewien problem a mianowicie sklep premium nie dzia?a zrobi?em go na serverprojekt zakupi?em sms'a i po wpisaniu wyskakuje Podany kod jest nieprawid?owy. ({"status":"fail","error":"wrong_amount"}) A kodu do konta nie doda?o

kod

function sprawdzIloscDni(gracz)
    local spr = exports["tiyl-db"]:dbGet("SELECT * FROM tiyl_gracze WHERE id=? AND vipdate>NOW() LIMIT 1", getElementData(gracz,"player:uid"))
    if (spr and #spr > 0) then
        return spr[1].vipdate
    end
    return false
end

function ustawIloscDni(gracz, dni)
    if sprawdzIloscDni(gracz) then
    local wyk = exports["tiyl-db"]:dbSet(string.format("UPDATE tiyl_gracze SET vipdate = DATE(vipdate) + INTERVAL %d DAY WHERE id=%d", dni, getElementData(gracz, "player:uid")))
    return end
    local wyk = exports["tiyl-db"]:dbSet(string.format("UPDATE tiyl_gracze SET vipdate = DATE(curdate()) + INTERVAL %d DAY WHERE id=%d", dni, getElementData(gracz, "player:uid")))
end

addEvent("skPremium", true)
addEventHandler("skPremium", root, function(kod, dni)
    local spr = "https://admin.serverproject.eu/api/smsapi.php?key=bcceb0a1b5b555c11791df589&code="..kod..""
    fetchRemote(spr, wyk, "", false, client, dni)
end)

function wyk(responseData, errno, playerToReceive, amount)
    if errno == 0 then
    if string.find(responseData, "kod") then
    amount = nil
        if string.find(responseData, '"number":"0"') then
            amount = 0
        elseif string.find(responseData, '"number":"7136"') then
            amount = 6
        elseif string.find(responseData, '"number":"75480"') then
            amount = 10
        elseif string.find(responseData, '"number":"79480"') then
            amount = 19
        elseif string.find(responseData, '"number":"91400"') then
            amount = 40
        elseif string.find(responseData, '"number":"91900"') then
            amount = 60
        end
        if not amount then return end
        outputChatBox("Zakupi?e? premium na "..amount.." dni.", playerToReceive)
        outputChatBox(getPlayerName(playerToReceive).." kupi? us?ug? PREMIUM na "..amount.." DNI, dzi?kujemy ?e nas wspierasz!", root, 0, 255, 0)
        setElementData(playerToReceive, "player:vip", true)
        ustawIloscDni(playerToReceive, amount)
        setPlayerNametagColor(playerToReceive, 255, 200, 0)
        triggerEvent("save:player",root,playerToReceive)
        triggerEvent("load:player",root,playerToReceive)
    else
        outputChatBox("Podany kod jest nieprawid?owy. ("..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


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-02-04, 17:43


OCBSlim







Wiek: 27
Na forum: 2844 dni
Posty: 43
Nick w MP: OCBSlim

Piwa: 415

Respekt: 60

Sprawd? czy na pewno wszystko podpi??e? prawid?owo.

Podpis
Może kiedyś wrócę z nowym projektem! ;-) Pozdrawiam!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-02-04, 18:23


killercycDDS

Migacz






Wiek: 26
Na forum: 4653 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1667

Respekt: 22

"OCBSlim" napisał/a:

Sprawd? czy na pewno wszystko podpi??e? prawid?owo.

ta

Postaw piwo autorowi tego posta
 

 
Tagi: premium :: api
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Odpowiedz do tematu

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
Dodaj temat do Ulubionych
Wersja do druku