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

Wysłany: 2018-03-04, 19:58


sasik12







Wiek: 26
Na forum: 3763 dni
Posty: 182

Piwa: 7

Respekt: 60

Witam . Mam pytanko jak zmieni? ten kod aby dzia?a? z microsms ?


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

function ustawIloscDni(graczdni)
    if sprawdzIloscDni(graczthen
    local wyk exports["ogrpg-db"]:dbSet(string.format("UPDATE ogrpg_users SET premiumdate = DATE(premiumdate) + INTERVAL %d DAY WHERE id=%d"dnigetElementData(gracz"player:uid")))
    return end
    local wyk exports["ogrpg-db"]:dbSet(string.format("UPDATE ogrpg_users SET premiumdate = DATE(curdate()) + INTERVAL %d DAY WHERE id=%d"dnigetElementData(gracz"player:uid")))
end

addEvent("skPremium"true)
addEventHandler("skPremium"root, function(koddni)
    local spr "https://admin.serverproject.eu/api/smsapi.php?key=ff63ca9e20f54c31816449bf4&code="..kod..""
    fetchRemote(sprwyk""falseclientdni)
end)

function wyk(responseDataerrnoplayerToReceiveamount)
    if errno == 0 then
    if string.find(responseData"kod"then
    amount nil
        if string.find(responseData'"number":"7136"'then
            amount 1
        elseif string.find(responseData'"number":"7255"'then
            amount 2
        elseif string.find(responseData'"number":"7636"'then
            amount 7
        elseif string.find(responseData'"number":"7136"'then
            amount 12
        elseif string.find(responseData'"number":"91955"'then
            amount 23
        elseif string.find(responseData'"number":"92555"'then
            amount 30
        end
        if not amount then return end
        outputChatBox("Zakupi?e? premium na "..amount.." dni."playerToReceive)
        setElementData(playerToReceive"player:premium"true)
        ustawIloscDni(playerToReceiveamount)
        triggerEvent("save:player",root,playerToReceive)
        triggerEvent("load:player",root,playerToReceive)
    else
        outputChatBox("Podany kod jest nieprawid?owy. ("..responseData..")"playerToReceive)
    end
end
end

function findPlayer(pph)
    for i,v in ipairs(getElementsByType("player")) do
        if tonumber(phthen
            if getElementData(v"id") == tonumber(phthen
                return getPlayerFromName(getPlayerName(v))
            end
        else
            if string.find(string.gsub(getPlayerName(v):lower(),"#%x%x%x%x%x%x"""), ph:lower(), 1truethen
                return getPlayerFromName(getPlayerName(v))
            end
        end
    end
end



local string string.format('http://microsms.pl/api/v2/multi.php?userid=%d&code=%s&serviceid=%d'premium['user_id'], codepremium['service_id'])


Z g?ry dzi?ki

Podpis
Uczeń LUA . Mapper MTA.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-04, 22:10


Ciastuuś

Truck soon...






Wiek: 26
Na forum: 3071 dni
Posty: 799
Nick w MP: Ciastuuś

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

Poprawnie,

local spr "http://microsms.pl/api/v2/multi.php?userid=xxxx&code="..kod.."&serviceid=xxxx"


Oczywi?cie dane musisz pozmienia?

Podpis
Truck soon...
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 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