Boski1234567891
Młody Skrypter
Wiek: 31 Na forum: 3444 dni Posty: 89
Nick w MP: Medyk312
Piwa : 1965
Cze??! chcia?em sie zapytac jakiegos skryptera jak on to robi ze jak by robi? serwer to mu to premium nie znika po reconnect .
Mam Paczk? GM Play Your Stories z naszego forum i chcial bym sie zapytac lub czy by mi ktos powiedza? jak to zrobic zeby ono nie znika?o komenda dziala ale na tab sie nie pokazuje kolor itd a po reconnect to znika.
Prosze o pomoc a kodzik tutaj oba daje
c_pgui.lua
Kod: [.lua]local data={ showed=nil, button={}}
local screenW, screenH = guiGetScreenSize()
local sx, sy = guiGetScreenSize()
function isMouseIn(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 renderZoneBox()
showCursor(true)
dxDrawRectangle(screenW * 0.3661, screenH * 0.0004, screenW * 0.2690, screenH * 0.9999, tocolor(0, 0, 0, 168), false)
dxDrawLine((screenW * 0.3655) - 1, (screenH * 0.2733) - 1, (screenW * 0.3655) - 1, screenH * 0.3200, tocolor(131, 26, 36, 216), 1, false)
dxDrawLine(screenW * 0.6351, (screenH * 0.2733) - 1, (screenW * 0.3655) - 1, (screenH * 0.2733) - 1, tocolor(131, 26, 36, 216), 1, false)
dxDrawLine((screenW * 0.3655) - 1, screenH * 0.3200, screenW * 0.6351, screenH * 0.3200, tocolor(131, 26, 36, 216), 1, false)
dxDrawLine(screenW * 0.6351, screenH * 0.3200, screenW * 0.6351, (screenH * 0.2733) - 1, tocolor(131, 26, 36, 216), 1, false)
dxDrawRectangle(screenW * 0.3655, screenH * 0.2733, screenW * 0.2696, screenH * 0.0467, tocolor(0, 0, 0, 161), false)
dxDrawText("SKLEP PREMIUM", screenW * 0.4310, screenH * 0.2876, screenW * 0.5696, screenH * 0.3105, tocolor(255, 255, 255, 255), 0.60, "bankgothic", "center", "center", false, false, false, false, false)
dxDrawText("PREMIUM NA ZAWSZE\nAA.SP na numer 7936 (11.07 z?)\n\n\n1. Czekamy na kod.\n2. Wysy?amy na E-Mail, b?d? G-Mail.\n3. Cieszymy si? kontem Premium!\n\nAdres E-Mail: bone.pystories@wp.pl\nG-Mail: bone.pystories@gmail.com", screenW * 0.3786, screenH * 0.3467, screenW * 0.6155, screenH * 0.4781, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, true, false, false, false)
-- dxDrawLine((screenW * 0.4179) - 1, (screenH * 0.6752) - 1, (screenW * 0.4179) - 1, screenH * 0.7210, tocolor(93, 51, 214, 161), 1, false)
--- dxDrawLine(screenW * 0.5857, (screenH * 0.6752) - 1, (screenW * 0.4179) - 1, (screenH * 0.6752) - 1, tocolor(93, 51, 214, 161), 1, false)
-- dxDrawLine((screenW * 0.4179) - 1, screenH * 0.7210, screenW * 0.5857, screenH * 0.7210, tocolor(93, 51, 214, 161), 1, false)
-- dxDrawLine(screenW * 0.5857, screenH * 0.7210, screenW * 0.5857, (screenH * 0.6752) - 1, tocolor(93, 51, 214, 161), 1, false)
--- dxDrawRectangle(screenW * 0.4179, screenH * 0.6752, screenW * 0.1679, screenH * 0.0457, tocolor(0, 0, 0, 98), false)
--dxDrawText("Aby zamkn?? \nWpisz /premium ", screenW * 0.4561, screenH * 0.6818, screenW * 0.5452, screenH * 0.7048, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false)
end
--[[addEventHandler("onClientClick", root, function(btn,state)
if btn=="left" and state=="down" then
if isMouseIn(screenW * 0.4601, screenH * 0.6848, screenW * 0.5452, screenH * 0.7048) and data.showed then
outputChatBox("Ten kod ("..guiGetText(data.button[1])..") wyslij na pm do GryguJunior,Kuba (/pm Kuba,GryguJunior , "..guiGetText(data.button[1])..")")
if guiCheckBoxGetSelected(data.button[2]) then amount = "19" else amount = "9" end
triggerServerEvent("premiumActive", localPlayer, guiGetText(data.button[1]),amount)
destroyElement(data.button[1])
destroyElement(data.button[2])
removeEventHandler("onClientRender", root, renderZoneBox)
data.showed=false
showCursor(false)
elseif isMouseIn(screenW * 0.3655, screenH * 0.2733, screenW * 0.2696, screenH * 0.0467) and data.showed then
destroyElement(data.button[1])
destroyElement(data.button[2])
removeEventHandler("onClientRender", root, renderZoneBox)
data.showed=false
showCursor(false)
end
end
end)--]]
function premiumshow()
if data.showed then
--destroyElement(data.button[1])
--destroyElement(data.button[2])
removeEventHandler("onClientRender", root, renderZoneBox)
data.showed=false
showCursor(false)
else
addEventHandler("onClientRender", root, renderZoneBox)
--data.button[1] = guiCreateEdit(0.40, 0.57, 0.21, 0.05, "", true)
--data.button[2] = guiCreateCheckBox(0.40, 0.61, 0.21, 0.05, "D?u?sze premium (30 dni)", false,true)
--guiEditSetMaxLength(data.button[1], 8)
data.showed=true
end
end
addCommandHandler('premium', premiumshow)[./lua]
s_pgui.lua
Kod: [.lua]api="c79ecf069d3e4b1d58a6d6c5e"
function getPremiumDate(plr)
local queryA=exports['ogrpg-db']:dbGet("SELECT * FROM ogrpg_users WHERE id=? AND premiumdate>NOW() LIMIT 1", getElementData(plr,"player:uid"))
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['ogrpg-db']:dbSet(string.format("UPDATE ogrpg_users SET premiumdate = DATE(premiumdate) + INTERVAL %d DAY WHERE id=%d",days,getElementData(plr,"player:uid")))
return end
local queryA=exports['ogrpg-db']:dbSet(string.format("UPDATE ogrpg_users SET premiumdate = DATE(curdate()) + INTERVAL %d DAY WHERE id=%d",days,getElementData(plr,"player:uid")))
end
addEvent("premiumActive", true)
addEventHandler("premiumActive", root, function(code,amount,number)
if not code then return end
outputDebugString(code..":"..amount)
local x=exports['ogrpg-db']:dbGet("SELECT * from ogrpg_premium_code where code=?",code)
if x and #x > 0 then
if x[1].active < 1 then outputChatBox("*B??dny -Kod",client) return end
local xamount = tonumber(x[1].amount)
if xamount == tonumber(amount) then
exports['ogrpg-db']:dbSet("UPDATE ogrpg_premium_code set active=0,active_date=NOW(),active_uid=? where code=?",getElementData(client,"player:uid"),code)
if tonumber(amount) == 1508 then amount = 15 else amount = 30 end
setPremiumDay(client,amount)
triggerEvent("save:player",root,client)
triggerEvent("load:player",root,client)
setElementData(client,"player:premium",true)
outputChatBox("Kupiono konto premium na "..amount.." dni! Weso?ego dnia !", client)
else
outputChatBox("B??dny ekod",client) return
end
return end
local query=string.format("http://microsms.pl/api/check.php?userid=1088&number=%s&code=%s&serviceid=%s", number,code,amount)
fetchRemote( query, result,"",false, client,amount,number)
end)
function result(responseData, errno, playerToReceive,amount)
if errno == 0 then
local x = split(responseData,",")
if not x then return end
if string.find(x[1],"1") then
if tonumber(amount) == 1508 then amount = 15 else amount = 30 end
setPremiumDay(playerToReceive,amount)
outputChatBox("Kupiono konto premium na "..amount.." dni! Weso?ego dnia !", 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("dajvipa",function(plr,cmd,cel,dni)
if exports['dutyadmin']:getAdmin(plr,3) or exports['dutyadmin']:getAdmin(plr,4) then
if not cel then outputChatBox("/dajvipa [gracz] [dni]",plr) return end
if not dni then outputChatBox("/dajvipa [gracz] [dni]",plr) return end
if not tonumber(dni) then outputChatBox("/dajvipa [gracz] [dni]",plr) return end
local target=exports["ogrpg-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 dla "..getPlayerName(target):gsub("#%x%x%x%x%x%x",""), plr)
outputChatBox("Otrzymales konto premium na "..dni.." dni od "..getPlayerName(plr):gsub("#%x%x%x%x%x%x",""), target)
triggerEvent("save:player",root,target)
triggerEvent("load:player",root,target)
setElementData(target,"player:premium",true)
end
end)
addCommandHandler("losvip",function(plr)
if exports['dutyadmin']:getAdmin(plr,4) then
local los = getRandomPlayer()
if not los then return end
setPremiumDay(los,15)
outputChatBox("Losowanie konta premium na 1 dzie?..", root)
outputChatBox("Losowe konto PREMIUM otrzymuje gracz o nicku "..getPlayerName(los):gsub("#%x%x%x%x%x%x","").." na 15 dzie?", root)
outputChatBox("Otrzymales konto premium na 1 dzie?.", los)
triggerEvent("save:player",root,los)
triggerEvent("load:player",root,los)
setElementData(los,"player:premium",true)
end
end)
addCommandHandler("losvip2",function(plr)
if exports['dutyadmin']:getAdmin(plr,4) then
local los2 = getRandomPlayer()
if not los2 then return end
setPremiumDay(los2,30)
outputChatBox("Losowanie konta premium na 30 dni..", root)
outputChatBox("Losowe konto PREMIUM otrzymuje gracz o nicku "..getPlayerName(los2):gsub("#%x%x%x%x%x%x","").." na 30 dni!", root)
outputChatBox("Otrzymales konto premium na 30 dni.", los2)
triggerEvent("save:player",root,los2)
triggerEvent("load:player",root,los2)
setElementData(los2,"player:premium",true)
end
end)
function RGBToHex(red, green, blue, alpha)
if ( (red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255) ) ) then
return nil
end
if ( alpha ) then
return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha)
else
return string.format("#%.2X%.2X%.2X", red,green,blue)
end
end
addCommandHandler("losvip3",function(plr)
if exports['dutyadmin']:getAdmin(plr,4) then
for k,v in ipairs(getElementsByType ( "player" )) do
if not getElementData(v, "player:uid") then return end
iledni=3
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("losvip3",function(plr)
if exports['dutyadmin']:getAdmin(plr,4) then
outputChatBox("Z powodu dobrego humoru Butlipana, ca?y serwer otrzyma? premium na "..iledni.." dzie?!", root, 0, 192, 255)
end
end)[./lua]