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

Wysłany: 2020-06-18, 12:15


Matikmontana

Modern Stories






Wiek: 22
Na forum: 2473 dni
Posty: 423
Nick w MP: Mazeusz*

Piwa: 1015

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
Cze??, m?g?by kto? rzuci? okiem na skrypt na kupno premium czy b?dzie dzia?a?. W db3 nie ma b??d?w. Naj?atwiej by?o by sprawdzi? poprzez kupno jakiej? premki tylko ?e w obecnej chwili nie mam mo?liwo??.


local nametagFont dxCreateFont":czcionka/f.ttf"10 )
if not nametagFont then nametagFont "default-bold" end

local wFont dxCreateFont":czcionka/f.ttf"15 )
if not wFont then wFont "default-bold" end

local wFont2 dxCreateFont":czcionka/f.ttf"12 )
if not wFont2 then wFont2 "default-bold" end

local lFont dxCreateFont(":czcionka/f.ttf"15)
if not lFont then lFont "default-bold" end

local nCz dxCreateFont":czcionka/f.ttf"10 )
if not nCz then nCz "default-bold" end

local screenWscreenH guiGetScreenSize()
local sxsy guiGetScreenSize()

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

local gp = {}

gp.napisy guiCreateLabel(0.450.290.200.32""true)
guiSetFont(gp.napisy"default-bold-small")
guiLabelSetHorizontalAlign(gp.napisy"center"false)
guiLabelSetVerticalAlign(gp.napisy"center")
gp.d3 guiCreateCheckBox(0.360.310.080.04"Premium 3 dni"falsetrue)
gp.d7 guiCreateCheckBox(0.360.380.080.04"Premium 7 dni"falsetrue)
gp.d14 guiCreateCheckBox(0.360.460.080.04"Premium 14 dni"falsetrue)
gp.d30 guiCreateCheckBox(0.360.530.080.04"Premium 45 dni"falsetrue)
gp.kod guiCreateEdit(0.360.590.080.05"Kod"true)    
guiSetVisible(gp.napisyfalse)
guiSetVisible(gp.d3false)
guiSetVisible(gp.d7false)
guiSetVisible(gp.d14false)
guiSetVisible(gp.d30false)
guiSetVisible(gp.kodfalse)

addEventHandler("onClientGUIClick"resourceRoot, function()
    if source == gp.d3 or source == gp.d7 or source == gp.d14 or source == gp.d30 then
        if not guiCheckBoxGetSelected(gp.d3) or not guiCheckBoxGetSelected(gp.d7) or not guiCheckBoxGetSelected(gp.d14) or not guiCheckBoxGetSelected(gp.d30then
            guiSetText(gp.napisy"")
        end
        if guiCheckBoxGetSelected(gp.d3then
            guiCheckBoxSetSelected(gp.d7false)
            guiCheckBoxSetSelected(gp.d14false)
            guiCheckBoxSetSelected(gp.d30false)
            guiSetText(gp.napisy"Aby zakupi? premium na 3 dni:\nWy?lij SMS na numer 7355 o\ntre?ci AA.SP koszt smsa 3,69 z? brutto.\nNast?pnie wpisz kod w okno kod i kliknij zakup.")
        elseif guiCheckBoxGetSelected(gp.d7then
            guiCheckBoxSetSelected(gp.d3false)
            guiCheckBoxSetSelected(gp.d14false)
            guiCheckBoxSetSelected(gp.d30false)
            guiSetText(gp.napisy"Aby zakupi? premium na 7 dni:\nWy?lij SMS na numer 7555 o\ntre?ci AA.SP koszt smsa 6,15 z? brutto.\nNast?pnie wpisz kod w okno kod i kliknij zakup.")
        elseif guiCheckBoxGetSelected(gp.d14then
            guiCheckBoxSetSelected(gp.d7false)
            guiCheckBoxSetSelected(gp.d3false)
            guiCheckBoxSetSelected(gp.d30false)
            guiSetText(gp.napisy"Aby zakupi? premium na 14 dni:\nWy?lij SMS na numer 7936 o\ntre?ci AA.SP koszt smsa 11,07 z? brutto.\nNast?pnie wpisz kod w okno kod i kliknij zakup.")
        elseif guiCheckBoxGetSelected(gp.d30then
            guiCheckBoxSetSelected(gp.d7false)
            guiCheckBoxSetSelected(gp.d14false)
            guiCheckBoxSetSelected(gp.d3false)  
            guiSetText(gp.napisy"Aby zakupi? premium na 45 dni:\nWy?lij SMS na numer 91955 o\ntre?ci AA.SP koszt smsa 23,37 z? brutto.\nNast?pnie wpisz kod w okno kod i kliknij zakup.")
        end
    end
end)

local pp false

function guiPremka()
        --dxDrawBluredRectangle(screenW 0.3309screenH 0.1901screenW 0.3389screenH 0.6211tocolor(150150150255))
        dxDrawRectangle(screenW 0.3309screenH 0.1901screenW 0.3389screenH 0.6211tocolor(000168), false)
        dxDrawRectangle(screenW 0.3309screenH 0.1901screenW 0.3389screenH 0.0508tocolor(2575125155), false)
        dxDrawText("Panel zakupu premium", (screenW 0.3309) + 1, (screenH 0.1888) + 1, (screenW 0.6698) + 1, (screenH 0.2409) + 1tocolor(000255), 1.00wFont"center""center"falsefalsefalsefalsefalse)
        dxDrawText("Panel zakupu premium"screenW 0.3309screenH 0.1888screenW 0.6698screenH 0.2409tocolor(255255255255), 1.00wFont"center""center"falsefalsefalsefalsefalse)
           if mysz(screenW 0.4034screenH 0.6576screenW 0.1940screenH 0.0599then
            dxDrawRectangle(screenW 0.4034screenH 0.6576screenW 0.1940screenH 0.0599tocolor(2575125180), false)
        else
            dxDrawRectangle(screenW 0.4034screenH 0.6576screenW 0.1940screenH 0.0599tocolor(2575125125), false)
        end
           if mysz(screenW 0.4034screenH 0.7305screenW 0.1940screenH 0.0599then
            dxDrawRectangle(screenW 0.4034screenH 0.7305screenW 0.1940screenH 0.0599tocolor(2575125180), false)
        else
            dxDrawRectangle(screenW 0.4034screenH 0.7305screenW 0.1940screenH 0.0599tocolor(2575125125), false)
        end
        dxDrawText("Zakup konto premium", (screenW 0.4026) + 1, (screenH 0.6563) + 1, (screenW 0.5974) + 1, (screenH 0.7174) + 1tocolor(000255), 1.00wFont"center""center"falsefalsefalsefalsefalse)
        dxDrawText("Zakup konto premium"screenW 0.4026screenH 0.6563screenW 0.5974screenH 0.7174tocolor(255255255255), 1.00wFont"center""center"falsefalsefalsefalsefalse)
        dxDrawText("Anuluj zakup premium", (screenW 0.4026) + 1, (screenH 0.7305) + 1, (screenW 0.5974) + 1, (screenH 0.7904) + 1tocolor(000255), 1.00wFont"center""center"falsefalsefalsefalsefalse)
        dxDrawText("Anuluj zakup premium"screenW 0.4026screenH 0.7305screenW 0.5974screenH 0.7904tocolor(255255255255), 1.00wFont"center""center"falsefalsefalsefalsefalse)
end

addEventHandler("onClientClick"root, function(bs)
    if ~= "state" and ~= "down" then return end
    if mysz(screenW 0.4034screenH 0.6576screenW 0.1940screenH 0.0599) and pp == true then
        if guiGetText(gp.kod) == "Kod" then return end
        local dni 0
        if guiCheckBoxGetSelected(gp.d3then
            dni 3
        elseif guiCheckBoxGetSelected(gp.d7then
            dni 7
        elseif guiCheckBoxGetSelected(gp.d14then
            dni 14
        elseif guiCheckBoxGetSelected(gp.d30then
            dni 45
        else
            dni 0
        end
        if dni == 0 then
            exports["notifikacje"]:noti("Nie wybra?e? ilo??i dni!")
            return
        end
        if dni == 45 then
            dni "19"
        elseif dni == 14 then
            dni "9"
        elseif dni == 7 then
            dni "5"
        elseif dni == 3 then
            dni "3"
        end
        triggerServerEvent("premiumActive"localPlayerguiGetText(gp.kod), dni)
        pp false
        guiSetVisible(gp.napisyfalse)
        guiSetVisible(gp.d3false)
        guiSetVisible(gp.d7false)
        guiSetVisible(gp.d14false)
        guiSetVisible(gp.d30false)
        guiSetVisible(gp.kodfalse)
        showCursor(false)
        removeEventHandler("onClientPreRender"rootguiPremka)
    elseif mysz(screenW 0.4034screenH 0.7305screenW 0.1940screenH 0.0599) and pp == true then
        pp false
        guiSetVisible(gp.napisyfalse)
        guiSetVisible(gp.d3false)
        guiSetVisible(gp.d7false)
        guiSetVisible(gp.d14false)
        guiSetVisible(gp.d30false)
        guiSetVisible(gp.kodfalse)
        showCursor(false)
        removeEventHandler("onClientPreRender"rootguiPremka)
    end
end)

addCommandHandler("premium", function()
    if pp ~= true then
        pp true
        guiSetVisible(gp.napisytrue)
        guiSetVisible(gp.d3true)
        guiSetVisible(gp.d7true)
        guiSetVisible(gp.d14true)
        guiSetVisible(gp.d30true)
        guiSetVisible(gp.kodtrue)
        showCursor(truefalse)
        addEventHandler("onClientPreRender"rootguiPremka)
    else
        pp false
        guiSetVisible(gp.napisyfalse)
        guiSetVisible(gp.d3false)
        guiSetVisible(gp.d7false)
        guiSetVisible(gp.d14false)
        guiSetVisible(gp.d30false)
        guiSetVisible(gp.kodfalse)
        showCursor(false)
        removeEventHandler("onClientPreRender"rootguiPremka)
    end
end)



S
--[[
 Code write by YolosPermissions to use only by agree from Yolos.
]]
api="bj9lN545v6xbCdRBhCBJuDiO6"
function getPremiumDate(plr)
    local queryA=exports['pystories-db']:dbGet("SELECT * FROM pystories_users WHERE id=? AND premiumdate>NOW() LIMIT 1"getElementData(plr,"player:sid"))
    if (queryA and #queryA > 0) then
        return queryA[1].premiumdate
    end
    return false    
end


function setPremiumDay(plr,days)
    if getPremiumDate(plrthen
    local queryA=exports['pystories-db']:dbSet(string.format("UPDATE pystories_users SET premiumdate = DATE(premiumdate) + INTERVAL %d DAY WHERE id=%d",days,getElementData(plr,"player:sid")))
    return end
    local queryA=exports['pystories-db']:dbSet(string.format("UPDATE pystories_users SET premiumdate = DATE(curdate()) + INTERVAL %d DAY WHERE id=%d",days,getElementData(plr,"player:sid")))                             api1="bj9lN545v6xbCdRBhCBJuDiO6"
end

addEvent("premiumActive"true)
addEventHandler("premiumActive"root, function(code,amount)
    outputDebugString("pystories-guiPremiumNowe> "..getPlayerName(client).." zakupi?(a) konto premium:"..code..":"..amount)
    local query=string.format("http://admin.serverproject.pl/api/smsapi.php?key="..api.."&amount=%s&code=%s&desc=%s"tostring(amount),code,string.format("SID:"..getElementData(client,"player:sid")))
    fetchRemotequeryresult,"",falseclient,amount)
end)

function result(responseDataerrnoplayerToReceive,amount)
    if errno == 0 then
    if string.find(responseData,"ok"then
        if tonumber(amount) == 9 then amount 30 else amount 60 end
        setPremiumDay(playerToReceive,amount)
        outputChatBox("* Zakupiono konto premium na "..amount.." dni!"playerToReceive)
    --`    setElementData(playerToReceive,"player:premium", true)
        triggerEvent("save:player",root,playerToReceive)
        triggerEvent("load:player",root,playerToReceive)
    else
        outputChatBox("* B??dny Kod ("..responseData..")", playerToReceive)
--        outputChatBox("*B??dny Kod", client)
    end
    end
end



addCommandHandler("qkx.vip",function(plr,cmd,cel,dni) 
    if exports['pystories-admin']:getAdmin(plr,4) then
    if not cel then outputChatBox("/qkx.vip [gracz] [dni]",plr) return end
    if not dni then outputChatBox("/qkx.vip [gracz] [dni]",plr) return end
    if not tonumber(dni) then outputChatBox("/qkx.vip [gracz] [dni]",plr) return end
        local target=exports["pystories-core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza.", plr, 255, 0, 0)
            return
        end
        setPremiumDay(target,dni)
        outputChatBox("* Nadano konto premium na "..dni.." dni !", plr)
        outputChatBox("* Otrzyma?e?(a?) konto premium na "..dni.." dni !", target)
        triggerEvent("save:player",root,target)
        triggerEvent("load:player",root,target)
        setElementData(target,"player:premium",true)
    end
end)


addCommandHandler("qkx.rozdajpremke",function(plr)
    if getElementData(plr,"player:sid") == 1 then
    for k,v in ipairs(getElementsByType ( "player" )) do
    if not getElementData(v, "player:sid") then return end
        iledni=2
        setPremiumDay(v,iledni)
        triggerEvent("save:player",root,v)
        triggerEvent("load:player",root,v)
        setElementData(v,"player:premium",true)
                gracze=v
                end
    end
    --outputChatBox("Z powodu dobrego humoru Butlipana, ca?y serwer otrzyma? premium na "..iledni.." dni!", gracze, 255, 255, 255)
end)

addCommandHandler("qkx.rozdajpremke",function(plr)
if getElementData(plr,"player:sid") == 1 then
outputChatBox("* Ca?y serwer otrzymuje konto premium na 1 dni !", root, 0, 192, 255)
end
end)


Podpis


Modern Stories
Discord
https://discord.gg/MRJSYq8
Forum
https://msmta.pl
Panel Gracza
https://panel.msmta.pl
Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-06-27, 21:33


P.Wiśnia

Programista LUA






Wiek: 24
Na forum: 4044 dni
Posty: 568
Nick w MP: P.Wiśnia

Piwa: 376

Respekt: 100
Respekt: 100

Skrypt b?dzie dzia?a?, w celu sprawdzenia ustaw kwot? kod?w na 0. A nast?pnie wprowad? oboj?tny 6 cyfrowy kod.

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Matikmontana
Tagi: kupno :: 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 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