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

Wysłany: 2018-04-02, 21:47


Cobey







Wiek: 25
Na forum: 3443 dni
Posty: 86
Nick w MP: Anonimowa

Piwa: 286

Respekt: -9

Ostrzeżeń: 100%
Cze??,tworz? serwer
na pukawce i niestety nie ma tutaj itemshopu,a tworz? system premium,czy pomoglby mi ktos w wyjasnieniu co i jak?
Nie wiem jak takowy system stworzy?,b?d? kto? ma gotowy i pomo?e mi przy pod??czeniu tego?
Taki system najlepiej jakby by? na serwer;x

Podpis
13.04.2018 [*] ArtWorld
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Gracz8908
Wysłany: 2018-04-02, 21:57


Ciastuuś

As-salamu alaykum






Wiek: 27
Na forum: 3212 dni
Posty: 800
Nick w MP: Ciastuuś

Piwa: 4304

Respekt: 640
Respekt: 640Respekt: 640

System Premium wyci?gni?ty z jakie? paczki, sprawny tylko potrzeba forum oraz konta microsms. Je?eli b?dziesz si? bra? za kod przer?b go pod w?asne *elementData oraz inne rzeczy... Gdy ju? masz forum cho?by na MyBB / IPS zak?adasz us?ug? sms podaj?c tam link do forum najlepiej na domenie *.pl - us?uga powinna by? 'SMS PREMIUM +18'

S:

function sprawdzIloscDni(gracz)
    local spr = exports["DB"]:dbOtrzymaj("SELECT * FROM uzytkownicy WHERE id=? AND premiumData>NOW() LIMIT 1", getElementData(gracz,"gracz:uid"))
    if (spr and #spr > 0) then
        return spr[1].premiumData
    end
    return false
end

function ustawIloscDni(gracz, dni)
    if sprawdzIloscDni(gracz) then
    local wyk = exports["DB"]:dbUstaw(string.format("UPDATE uzytkownicy SET premiumData = DATE(premiumData) + INTERVAL %d DAY WHERE id=%d", dni, getElementData(gracz, "gracz:uid")))
    return end
    local wyk = exports["DB"]:dbUstaw(string.format("UPDATE uzytkownicy SET premiumData = DATE(curdate()) + INTERVAL %d DAY WHERE id=%d", dni, getElementData(gracz, "gracz:uid")))
end

addEvent("skPremium", true)
addEventHandler("skPremium", root, function(kod, dni)
    local spr = "http://microsms.pl/api/v2/multi.php?userid=xxxx&code="..kod.."&serviceid=xxxx"
    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":"7136"') then
            amount = 1
        elseif string.find(responseData, '"number":"7455"') then
            amount = 3
        elseif string.find(responseData, '"number":"7936"') then
            amount = 7
        elseif string.find(responseData, '"number":"91155"') then
            amount = 14
        elseif string.find(responseData, '"number":"91955"') then
            amount = 30
        elseif string.find(responseData, '"number":"92555"') then
            amount = 60
        end
        if not amount then return end
        outputChatBox("Zakupi?e? premium na "..amount.." dni.", playerToReceive)
        setElementData(playerToReceive, "gracz:premium", true)
        ustawIloscDni(playerToReceive, amount)
        setPlayerNametagColor(playerToReceive, 255, 200, 0)
        triggerEvent("gracz:zapisz",root,playerToReceive)
        triggerEvent("load:player",root,playerToReceive)
    else
        outputChatBox("Podany kod jest nieprawid?owy. ("..responseData..")", playerToReceive)
    end
end
end

function znajdzGracza(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


C:

function isEventHandlerAdded(sEventName,pElementAttachedTo,func)
    if type(sEventName)=='string' and isElement(pElementAttachedTo) and type(func)=='function' then local aAttachedFunctions = getEventHandlers(sEventName,pElementAttachedTo)
    if type(aAttachedFunctions)=='table' and #aAttachedFunctions > 0 then for i,v in ipairs(aAttachedFunctions) do if v==func then return true end end end
    end return false
end

ww,hh = 1920, 1080
www,hhh = guiGetScreenSize()
wn, hn = (www/ww), (hhh/hh)

local screenW, screenH = guiGetScreenSize()
local sx, sy = guiGetScreenSize()

local gp = {}

editbox = guiCreateEdit(0.43, 0.49, 0.14, 0.04, "", true)
komboboks = guiCreateComboBox(0.44, 0.34, 0.12, 0.13, "", true)
guiComboBoxAddItem(komboboks, "1 dzie?")
guiComboBoxAddItem(komboboks, "3 dni")
guiComboBoxAddItem(komboboks, "7 dni")
guiComboBoxAddItem(komboboks, "14 dni")
guiComboBoxAddItem(komboboks, "30 dni")
guiComboBoxAddItem(komboboks, "60 dni")
guiSetVisible(komboboks,false)
guiSetVisible(editbox,false)
local pp = false

function mysz(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*sx,cy*sy
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end

function guiPremka()
        local a = interpolateBetween(0,0,255,255,0,255,((getTickCount()-tick)/3350),"Linear") 
        local a2 = interpolateBetween(0,0,141,141,0,141,((getTickCount()-tick)/3350),"Linear") 
        local wybrane = guiComboBoxGetSelected(komboboks)
        if not wybrane then return end
        local tekst = guiComboBoxGetItemText(komboboks,wybrane)
        if tekst == "1 dzie?" then
            txt="Tre?? sms: MSMS.PCG\nNumer: 7136\nKoszt: 1,23 z?\nPoni?ej wpisz otrzymany w sms kod:"
        elseif tekst == "3 dni" then
            txt="Tre?? sms: MSMS.PCG\nNumer: 7455\nKoszt: 4,92 z?\nPoni?ej wpisz otrzymany w sms kod:"
        elseif tekst == "7 dni" then
            txt="Tre?? sms: MSMS.PCG\nNumer: 7936\nKoszt: 11,07 z?\nPoni?ej wpisz otrzymany w sms kod:"
        elseif tekst == "14 dni" then
            txt="Tre?? sms: MSMS.PCG\nNumer: 91155\nKoszt: 13,53 z?\nPoni?ej wpisz otrzymany w sms kod:"
        elseif tekst == "30 dni" then
            txt="Tre?? sms: MSMS.PCG\nNumer: 91955\nKoszt: 23,27 z?\nPoni?ej wpisz otrzymany w sms kod:"
        elseif tekst == "60 dni" then
            txt="Tre?? sms: MSMS.PCG\nNumer: 92555\nKoszt: 30,75 z?\nPoni?ej wpisz otrzymany w sms kod:"
        else
            txt="Tre?? sms: --\nNumer: --\nKoszt: --\nPoni?ej wpisz otrzymany w sms kod:"
        end
        roundedRectangle(screenW * 0.3755, screenH * 0.2833, screenW * 0.2495, screenH * 0.4333, tocolor(1, 0, 0, 141), false)
        dxDrawText("Panel kupna konta premium\nPoni?ej wybierz ilo?? dni", (screenW * 0.3755) + 1, (screenH * 0.2889) + 1, (screenW * 0.6250) + 1, (screenH * 0.3343) + 1, tocolor(0, 0, 0, a), 1*wn, "default", "center", "center", false, false, false, false, false)
        dxDrawText("Panel kupna konta premium\nPoni?ej wybierz ilo?? dni", screenW * 0.3755, screenH * 0.2889, screenW * 0.6250, screenH * 0.3343, tocolor(255, 255, 255, a), 1*wn, "default", "center", "center", false, false, false, false, false)
        dxDrawText(txt, (screenW * 0.4385) + 1, (screenH * 0.3648) + 1, (screenW * 0.5615) + 1, (screenH * 0.4954) + 1, tocolor(0, 0, 0, a), 1*wn, "default", "center", "center", false, false, false, false, false)
        dxDrawText(txt, screenW * 0.4385, screenH * 0.3648, screenW * 0.5615, screenH * 0.4954, tocolor(255, 255, 255, a), 1*wn, "default", "center", "center", false, false, false, false, false)
        if mysz(screenW * 0.4307, screenH * 0.5750, screenW * 0.1396, screenH * 0.0583) then roundedRectangle(screenW * 0.4307, screenH * 0.5750, screenW * 0.1396, screenH * 0.0583, tocolor(0, 102, 204, a2), false) else roundedRectangle(screenW * 0.4307, screenH * 0.5750, screenW * 0.1396, screenH * 0.0583, tocolor(0, 102, 204, a), false) end
        --dxDrawText("Zakup premium", 827 + 1*wn, 621 + 1*hn, 1095 + 1*wn, 684 + 1*hn, tocolor(0, 0, 0, a), 1*wn, "default", "center", "center", false, false, false, false, false)
        dxDrawText("Zakup premium", 827*wn, 621*hn, 1095*wn, 684*hn, tocolor(255, 255, 255, a), 1*wn, "default", "center", "center", false, false, false, false, false)
        if mysz(screenW * 0.5984, screenH * 0.6685, screenW * 0.0214, screenH * 0.038) then roundedRectangle(screenW * 0.5984, screenH * 0.6685, screenW * 0.0214, screenH * 0.0389, tocolor(0, 102, 204, a2), false) else roundedRectangle(screenW * 0.5984, screenH * 0.6685, screenW * 0.0214, screenH * 0.0389, tocolor(0, 102, 204, a), false) end
      --  dxDrawText("X", (screenW * 0.5984) + 1, (screenH * 0.6676) + 1, (screenW * 0.6198) + 1, (screenH * 0.7074) + 1, tocolor(0, 0, 0, a), 1*wn, "default", "center", "center", false, false, false, false, false)
        dxDrawText("X", screenW * 0.5984, screenH * 0.6676, screenW * 0.6198, screenH * 0.7074, tocolor(255, 255, 255, a), 1*wn, "default", "center", "center", false, false, false, false, false)
end

addEventHandler("onClientClick", root, function(b, s)
    if b ~= "state" and s ~= "down" then return end
    if mysz(screenW * 0.4307, screenH * 0.5750, screenW * 0.1396, screenH * 0.0583) and pp == true then
        if guiGetText(editbox) == "" then return end
        local dni = 0
        local wybrane = guiComboBoxGetSelected(komboboks)
        if not wybrane then return end
        local tekst = guiComboBoxGetItemText(komboboks,wybrane)
        if tekst == "1 dzie?" then
            dni = 1
        elseif tekst == "3 dni" then
            dni = 3
        elseif tekst == "7 dni" then
            dni = 7
        elseif tekst == "14 dni" then
            dni = 14
        elseif tekst == "30 dni" then
            dni = 30
        elseif tekst == "60 dni" then
            dni = 60
        else
            dni = 0
        end
        if dni == 0 then
            outputChatBox("Nie wybra?e? ilo?ci dni, wybierz i kliknij ponownie.")
            return
        end
        triggerServerEvent("skPremium", localPlayer, guiGetText(editbox), dni)
    elseif mysz(screenW * 0.5984, screenH * 0.6685, screenW * 0.0214, screenH * 0.0389) and pp == true then
        pp = false
guiSetVisible(komboboks,false)
guiSetVisible(editbox,false)
        showCursor(false)
        setElementFrozen(localPlayer,false)
        removeEventHandler("onClientPreRender", root, guiPremka)
    end
end)

addCommandHandler("premium", function()
tick = getTickCount()
--if getPlayerSerial(localPlayer) == "8FE50105E2AB81DFA78E08780A079292" or getPlayerSerial(localPlayer) == "26B5B94341856F4168BD00A7DFF6CFB4" then
    if pp ~= true then
        pp = true
guiSetVisible(komboboks,true)
guiSetVisible(editbox,true)
        showCursor(true, false)
        setElementFrozen(localPlayer,true)
        addEventHandler("onClientPreRender", root, guiPremka)
    else
        pp = false
guiSetVisible(komboboks,false)
guiSetVisible(editbox,false)
        showCursor(false)
        setElementFrozen(localPlayer,false)
        removeEventHandler("onClientPreRender", root, guiPremka)
    --    end
    end
end)


function roundedRectangle(x, y, w, h, color)
  dxDrawRectangle(x, y, w, h, tocolor(255,255,255), false)
  dxDrawRectangle(x + 2, y - 1, w - 4, 1, tocolor(255,255,255), false)
  dxDrawRectangle(x + 2, y + h, w - 4, 1, tocolor(255,255,255), false)
  dxDrawRectangle(x - 1, y + 2, 1, h - 4, tocolor(255,255,255), false)
  dxDrawRectangle(x + w, y + 2, 1, h - 4, tocolor(255,255,255), false)
  dxDrawRectangle(x, y, w, h, color, false)
  dxDrawRectangle(x + 2, y - 1, w - 4, 1, color, false)
  dxDrawRectangle(x + 2, y + h, w - 4, 1, color, false)
  dxDrawRectangle(x - 1, y + 2, 1, h - 4, color, false)
  dxDrawRectangle(x + w, y + 2, 1, h - 4, color, false)
end


Podpis
As-salamu alaykum
Postaw piwo autorowi tego posta
 

 
Tagi: system :: premium(sms)
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » System Premium(SMS) 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