Matikmontana
Modern Stories
Wiek: 22 Na forum: 2473 dni Posty: 423
Nick w MP: Mazeusz*
Piwa : 1015
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 screenW , screenH = guiGetScreenSize ()
local sx , sy = 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.45 , 0.29 , 0.20 , 0.32 , "" , true )
guiSetFont ( gp . napisy , "default-bold-small" )
guiLabelSetHorizontalAlign ( gp . napisy , "center" , false )
guiLabelSetVerticalAlign ( gp . napisy , "center" )
gp . d3 = guiCreateCheckBox ( 0.36 , 0.31 , 0.08 , 0.04 , "Premium 3 dni" , false , true )
gp . d7 = guiCreateCheckBox ( 0.36 , 0.38 , 0.08 , 0.04 , "Premium 7 dni" , false , true )
gp . d14 = guiCreateCheckBox ( 0.36 , 0.46 , 0.08 , 0.04 , "Premium 14 dni" , false , true )
gp . d30 = guiCreateCheckBox ( 0.36 , 0.53 , 0.08 , 0.04 , "Premium 45 dni" , false , true )
gp . kod = guiCreateEdit ( 0.36 , 0.59 , 0.08 , 0.05 , "Kod" , true )
guiSetVisible ( gp . napisy , false )
guiSetVisible ( gp . d3 , false )
guiSetVisible ( gp . d7 , false )
guiSetVisible ( gp . d14 , false )
guiSetVisible ( gp . d30 , false )
guiSetVisible ( gp . kod , false )
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 . d30 ) then
guiSetText ( gp . napisy , "" )
end
if guiCheckBoxGetSelected ( gp . d3 ) then
guiCheckBoxSetSelected ( gp . d7 , false )
guiCheckBoxSetSelected ( gp . d14 , false )
guiCheckBoxSetSelected ( gp . d30 , false )
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 . d7 ) then
guiCheckBoxSetSelected ( gp . d3 , false )
guiCheckBoxSetSelected ( gp . d14 , false )
guiCheckBoxSetSelected ( gp . d30 , false )
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 . d14 ) then
guiCheckBoxSetSelected ( gp . d7 , false )
guiCheckBoxSetSelected ( gp . d3 , false )
guiCheckBoxSetSelected ( gp . d30 , false )
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 . d30 ) then
guiCheckBoxSetSelected ( gp . d7 , false )
guiCheckBoxSetSelected ( gp . d14 , false )
guiCheckBoxSetSelected ( gp . d3 , false )
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.3309 , screenH * 0.1901 , screenW * 0.3389 , screenH * 0.6211 , tocolor ( 150 , 150 , 150 , 255 ))
dxDrawRectangle ( screenW * 0.3309 , screenH * 0.1901 , screenW * 0.3389 , screenH * 0.6211 , tocolor ( 0 , 0 , 0 , 168 ), false )
dxDrawRectangle ( screenW * 0.3309 , screenH * 0.1901 , screenW * 0.3389 , screenH * 0.0508 , tocolor ( 25 , 75 , 125 , 155 ), false )
dxDrawText ( "Panel zakupu premium" , ( screenW * 0.3309 ) + 1 , ( screenH * 0.1888 ) + 1 , ( screenW * 0.6698 ) + 1 , ( screenH * 0.2409 ) + 1 , tocolor ( 0 , 0 , 0 , 255 ), 1.00 , wFont , "center" , "center" , false , false , false , false , false )
dxDrawText ( "Panel zakupu premium" , screenW * 0.3309 , screenH * 0.1888 , screenW * 0.6698 , screenH * 0.2409 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , wFont , "center" , "center" , false , false , false , false , false )
if mysz ( screenW * 0.4034 , screenH * 0.6576 , screenW * 0.1940 , screenH * 0.0599 ) then
dxDrawRectangle ( screenW * 0.4034 , screenH * 0.6576 , screenW * 0.1940 , screenH * 0.0599 , tocolor ( 25 , 75 , 125 , 180 ), false )
else
dxDrawRectangle ( screenW * 0.4034 , screenH * 0.6576 , screenW * 0.1940 , screenH * 0.0599 , tocolor ( 25 , 75 , 125 , 125 ), false )
end
if mysz ( screenW * 0.4034 , screenH * 0.7305 , screenW * 0.1940 , screenH * 0.0599 ) then
dxDrawRectangle ( screenW * 0.4034 , screenH * 0.7305 , screenW * 0.1940 , screenH * 0.0599 , tocolor ( 25 , 75 , 125 , 180 ), false )
else
dxDrawRectangle ( screenW * 0.4034 , screenH * 0.7305 , screenW * 0.1940 , screenH * 0.0599 , tocolor ( 25 , 75 , 125 , 125 ), false )
end
dxDrawText ( "Zakup konto premium" , ( screenW * 0.4026 ) + 1 , ( screenH * 0.6563 ) + 1 , ( screenW * 0.5974 ) + 1 , ( screenH * 0.7174 ) + 1 , tocolor ( 0 , 0 , 0 , 255 ), 1.00 , wFont , "center" , "center" , false , false , false , false , false )
dxDrawText ( "Zakup konto premium" , screenW * 0.4026 , screenH * 0.6563 , screenW * 0.5974 , screenH * 0.7174 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , wFont , "center" , "center" , false , false , false , false , false )
dxDrawText ( "Anuluj zakup premium" , ( screenW * 0.4026 ) + 1 , ( screenH * 0.7305 ) + 1 , ( screenW * 0.5974 ) + 1 , ( screenH * 0.7904 ) + 1 , tocolor ( 0 , 0 , 0 , 255 ), 1.00 , wFont , "center" , "center" , false , false , false , false , false )
dxDrawText ( "Anuluj zakup premium" , screenW * 0.4026 , screenH * 0.7305 , screenW * 0.5974 , screenH * 0.7904 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , wFont , "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.4034 , screenH * 0.6576 , screenW * 0.1940 , screenH * 0.0599 ) and pp == true then
if guiGetText ( gp . kod ) == "Kod" then return end
local dni = 0
if guiCheckBoxGetSelected ( gp . d3 ) then
dni = 3
elseif guiCheckBoxGetSelected ( gp . d7 ) then
dni = 7
elseif guiCheckBoxGetSelected ( gp . d14 ) then
dni = 14
elseif guiCheckBoxGetSelected ( gp . d30 ) then
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" , localPlayer , guiGetText ( gp . kod ), dni )
pp = false
guiSetVisible ( gp . napisy , false )
guiSetVisible ( gp . d3 , false )
guiSetVisible ( gp . d7 , false )
guiSetVisible ( gp . d14 , false )
guiSetVisible ( gp . d30 , false )
guiSetVisible ( gp . kod , false )
showCursor ( false )
removeEventHandler ( "onClientPreRender" , root , guiPremka )
elseif mysz ( screenW * 0.4034 , screenH * 0.7305 , screenW * 0.1940 , screenH * 0.0599 ) and pp == true then
pp = false
guiSetVisible ( gp . napisy , false )
guiSetVisible ( gp . d3 , false )
guiSetVisible ( gp . d7 , false )
guiSetVisible ( gp . d14 , false )
guiSetVisible ( gp . d30 , false )
guiSetVisible ( gp . kod , false )
showCursor ( false )
removeEventHandler ( "onClientPreRender" , root , guiPremka )
end
end )
addCommandHandler ( "premium" , function()
if pp ~= true then
pp = true
guiSetVisible ( gp . napisy , true )
guiSetVisible ( gp . d3 , true )
guiSetVisible ( gp . d7 , true )
guiSetVisible ( gp . d14 , true )
guiSetVisible ( gp . d30 , true )
guiSetVisible ( gp . kod , true )
showCursor ( true , false )
addEventHandler ( "onClientPreRender" , root , guiPremka )
else
pp = false
guiSetVisible ( gp . napisy , false )
guiSetVisible ( gp . d3 , false )
guiSetVisible ( gp . d7 , false )
guiSetVisible ( gp . d14 , false )
guiSetVisible ( gp . d30 , false )
guiSetVisible ( gp . kod , false )
showCursor ( false )
removeEventHandler ( "onClientPreRender" , root , guiPremka )
end
end )
S
--[[
Code write by Yolos . Permissions 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 ( plr ) then
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" )))
fetchRemote ( query , result , "" , false , client , amount )
end )
function result ( responseData , errno , playerToReceive , 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)