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

Wysłany: 2020-02-10, 16:43


Josemitek







Wiek: 26
Na forum: 2404 dni
Posty: 17
Nick w MP: Josek



Respekt: 50

Witam, mam problem. Zrobi?em premium i jak wpisuje kod w pole premium to po wpisaniu randomowych znak?w i tak doda mi punkt do kupna premium. Co ?le robi??


api="MOJEAPI" 

addEvent("sprawdzPremium"trueaddEventHandler("sprawdzPremium"root, function(code,amountoutputDebugString(code..":"..amountlocal query=string.format("http://admin.serverproject.pl/api/smsapi.php?key="..api.."&amount=%s&code=%s&desc=%s"tostring(amount),code,getElementData(client,"id:player"))
fetchRemotequerydajP,"",falseclient,amountend) 

function dajP(responseDatanerroplayerToReceiveamount)
    if nerro == 0 then
    if string.find(responseData"code"then
        if string.find(responseData'"number":"7136"'then
            amount 1
        elseif string.find(responseData'"number":"7355"'then
            amount 3
        elseif string.find(responseData'"number":"7555"'then
            amount 7
        elseif string.find(responseData'"number":"7936"'then
            amount 14
        elseif string.find(responseData'"number":"92555"'then
            amount 30
        end
        exports["notyfikacje"]:notka("Zakupi?e? "..amount.."punkt?w premium"playerToReceive"sukces")
        outputChatBox(getPlayerName(playerToReceive).." kupi? "..amount.."PP, dzi?kujemy ?e nas wspierasz!"root02550)
        setElementData(playerToReceive"pp", (getElementData(playerToReceive"pp") or 0)+amount)
    else
        exports["notyfikacje"]:notka("Podany kod jest nieprawid?owy. ("..responseData..")"playerToReceive"blad")
    end
end
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-02-10, 17:46


Maniekxx

Amator






Wiek: 24
Na forum: 2894 dni
Posty: 232
Nick w MP: Maniekxx

Piwa: 225

Respekt: 110
Respekt: 110

Ostrzeżeń: 20%
Spr?buj tak


api="MOJEAPI" 

addEvent("sprawdzPremium"trueaddEventHandler("sprawdzPremium"root, function(code,amountoutputDebugString(code..":"..amountlocal query=string.format("http://admin.serverproject.pl/api/smsapi.php?key="..api.."&amount=%s&code=%s&desc=%s"tostring(amount),code,getElementData(client,"id:player"))
fetchRemotequerydajP,"",falseclient,amountend) 

function dajP(responseDatanerroplayerToReceiveamount)
    if nerro == 0 then
    if string.find(responseData"code") == false then outputChatBox("* Podany kod jest nieprawid?owy!") -- Musisz jeszcze zdefiniowagraczenie wiem czy kod jest po stronie Client'a czy Serwer'a.
        if string.find(responseData'"number":"7136"'then
            amount 1
        elseif string.find(responseData'"number":"7355"'then
            amount 3
        elseif string.find(responseData'"number":"7555"'then
            amount 7
        elseif string.find(responseData'"number":"7936"'then
            amount 14
        elseif string.find(responseData'"number":"92555"'then
            amount 30
        end
        exports["notyfikacje"]:notka("Zakupi?e? "..amount.."punkt?w premium"playerToReceive"sukces")
        outputChatBox(getPlayerName(playerToReceive).." kupi? "..amount.."PP, dzi?kujemy ?e nas wspierasz!"root02550)
        setElementData(playerToReceive"pp", (getElementData(playerToReceive"pp") or 0)+amount)
    else
        exports["notyfikacje"]:notka("Podany kod jest nieprawid?owy. ("..responseData..")"playerToReceive"blad")
    end
end
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-02-10, 18:57


Josemitek







Wiek: 26
Na forum: 2404 dni
Posty: 17
Nick w MP: Josek



Respekt: 50

Teraz jest niby okej, ale jak kupie premium, przepisze kod z smsa to wyskakuje: Podany kod jest nieprawid?owy. ({"status":"ok","amount":"1"}) czyli nieprawid?owa kwota netto sms'a. Je?li wpisze inny kod lub ten sam znow (wykorzystany): Podany kod jest nieprawid?owy. ({"status":"fail","error":"bad_code"}) czyli poprostu b??dny/wykorzystany kod. A i wiadomo?? na chacie jak bledny kod wprowadzam nie wyskakuje. Kod jest po stronie serwera.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-02-10, 20:15


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Jeste? pewny, ?e API zwraca Ci numer SMS'a a nie kwot?? Przygl?dnij si? stronie odno?nie API SMS na ServerProject.

Tymczasem podrzuc? Ci cz??? przyk?adowego gotowego kodu zastosowania API wykonanego przez .WhiteBlue dla ServerProject.

    if string.find(responseData'"error":"bad_code"'then
        outputChatBox('* Wprowadzony kod jest nieprawid?owy lub zosta? wykorzystany.'playerToReceive)
        return
    end

    if string.find(responseData'"status":"fail"'then
        outputChatBox('* Wyst?pi? nieznany b??d podczas zakupu us?ugi.'playerToReceive)
        return
    end

    local days nil

    if string.find(responseData'"amount":"1"'then days 3 end
    if string.find(responseData'"amount":"2"'then days 7 end
    if string.find(responseData'"amount":"3"'then days 14 end
    if string.find(responseData'"amount":"4"'then days 30 end


Pe?ny zas?b: http://serverproject.eu/files/smsapi-v1-lua.zip

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Josemitek
Wysłany: 2020-02-10, 20:31


Josemitek







Wiek: 26
Na forum: 2404 dni
Posty: 17
Nick w MP: Josek



Respekt: 50

Dobra, moja g?upota nie zna granic ;D Dziekuje ci kolejny raz WIlqu!

Postaw piwo autorowi tego posta
 

 
Tagi: premium
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

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