Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
Witam ot?? dopiszecie mi jaki? kodzik do tego by by?o wi?cej hajsu w banku bo jest limit 2kkk nwm jak to zwi?kszy? lub prosi?ym o skrypt kt?ry daje mo?liwo?ci zwi?kszenia got?wki przy sobie z 99kk na 999kkk
Bankomaty:
bankomaty_c.lua
local bankomaty ={
{ 92.28 , 1049.50 , 13.61 - 0.35 , - 0.00 , 0.00 , 89.13 }, -- Salon Doherty .
{- 1648.90 , 1202.50 , 7.25 - 0.35 , - 0.00 , 0.00 , 180.47 }, -- Salon Downtown .
{- 1603.62 , 710.27 , 13.87 - 0.35 , - 0.00 , 0.00 , 178.86 }, -- Komenda G ?? wna Policji .
{- 2460.16 ,- 316.03 , 41.40 , - 0.00 , 0.00 , 270.00 }, -- G ? rnik
{- 2620.64 , 1414.93 , 7.09 - 0.4 , - 0.00 , 0.00 , - 64 , 93 }, -- Bankomat
{- 1517.13 , 492.92 , 0.78 , - 0.00 , 0.00 , 100.50 }, -- ?? dki
{ 1460.35 , - 1256.25 , 813.50 , - 0.00 , 0.00 , 0.00 }, -- URZ ? D SF
{- 1719.50 , - 130.18 , 3.15 , - 0.00 , 0.00 , - 45.00 }, -- TuneDiagnostyka
{- 1832.11 , 110.48 , 14.50 , - 0.00 , 0.00 , - 180.00 }, -- TuneVizu
{- 1707.91 , 1351.03 , 6.75 , - 0.00 , 0.00 , 45.00 }, -- Spawn32
{- 1910.19 , 278.73 , 40.55 , - 0.00 , 0.00 , - 90.00 }, -- Licka DOherty
{- 1379.43 , - 531.44 , 13.65 , - 0.00 , 0.00 , 30.00 }, -- Lot SF
{- 1243.80 , 33.19 , 13.60 , - 0.00 , 0.00 , - 140.00 }, -- Naprawa Lot SF
{- 2735.25 , 115.72 , 4.00 , - 0 , 0 , - 90.353050231934 }, -- Komis Pyrek
{- 22.14 , 1175.24 , 19.00 , - 0 , 0 , - 180 },
{- 332.03 , 1537.02 , 75.00 , - 0 , 0 , 0 }, -- Komis SZYSZAK
{- 2029.80 , 435.04 , 34.80 , - 0 , 0 , 0 }, -- Komis xNancio
{ 2494.39 , 1887.15 , 10.00 , - 0 , 0 , - 180 }, -- Magazyn z TOPKAMI
}
for i , v in ipairs ( bankomaty ) do
v . obiekt = createObject ( 2618 , v [ 1 ], v [ 2 ], v [ 3 ]- 0.7 , v [ 4 ], v [ 5 ], v [ 6 ])
setElementInterior ( v . obiekt , v [ 7 ] or 0 )
setElementDimension ( v . obiekt , v [ 8 ] or 0 )
setElementFrozen ( v . obiekt , true )
setObjectBreakable ( v . obiekt , false )
setElementInterior ( v . mapicon , v [ 7 ] or 0 )
setElementDimension ( v . mapicon , v [ 8 ] or 0 )
v . cs = createColSphere ( v [ 1 ], v [ 2 ], v [ 3 ]+ 1 , 1 )
setElementInterior ( v . cs , v [ 7 ] or 0 )
setElementDimension ( v . cs , v [ 8 ] or 0 )
v . text = createElement ( 'text' )
setElementData ( v . text , "name" , "Bankomat" )
setElementPosition ( v . text , v [ 1 ], v [ 2 ], v [ 3 ]+ 1 )
end
local screenW , screenH = guiGetScreenSize ()
local bw ={}
bw . lbl1 = guiCreateLabel ( 0.78 , 0.40 , 0.17 , 0.07 , "Stan konta:\n0 PLN" , true )
local font0_money = guiCreateFont ( ":ogrpg-gui/epik.ttf" , 12 )
guiSetFont ( bw . lbl1 , font0_money )
guiLabelSetVerticalAlign ( bw . lbl1 , "center" )
guiLabelSetHorizontalAlign ( bw . lbl1 , "center" , false )
bw . edt1 = guiCreateEdit ( 0.775 , 0.605 , 0.08 , 0.04 , "0" , true ) -- wplac
bw . edt2 = guiCreateEdit ( 0.775 , 0.505 , 0.08 , 0.04 , "0" , true ) -- wyplac
guiSetVisible ( bw . lbl1 , false )
guiSetVisible ( bw . edt1 , false )
guiSetVisible ( bw . edt2 , false )
panel = false
function BankGUI ()
local r , g , b = interpolateBetween ( 255 , 255 , 255 , 20 , 250 , 0 ,( getTickCount ()- czas )/ 1100 , "SineCurve" )
local r2 , g2 , b2 = interpolateBetween ( 255 , 255 , 255 , 255 , 0 , 0 ,( getTickCount ()- czas )/ 1100 , "SineCurve" )
dxDrawImage ( screenW * 0.7255 , screenH * 0.3451 , screenW * 0.7943 , screenH * 0.5339 , "okn2.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 180 ), false )
if not cursorPosition ( screenW * 0.8682 , screenH * 0.5052 , screenW * 0.0798 , screenH * 0.0404 ) then -- wyplac
dxDrawImage ( screenW * 0.8448 , screenH * 0.4466 , screenW * 0.1340 , screenH * 0.1497 , "przycisk.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false )
dxDrawText ( "Wyp?a?" , ( screenW * 0.8690 ) + 1 , ( screenH * 0.5052 ) + 1 , ( screenW * 0.9480 ) + 1 , ( screenH * 0.5430 ) + 1 , tocolor ( 0 , 0 , 0 , 255 ), 1.12 , "default-bold" , "center" , "center" , false , false , false , false , false )
dxDrawText ( "Wyp?a?" , screenW * 0.8690 , screenH * 0.5052 , screenW * 0.9480 , screenH * 0.5430 , tocolor ( 255 , 255 , 255 , 255 ), 1.12 , "default-bold" , "center" , "center" , false , false , false , false , false )
else
dxDrawImage ( screenW * 0.8448 , screenH * 0.4466 , screenW * 0.1340 , screenH * 0.1497 , "przycisk.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false )
dxDrawText ( "Wyp?a?" , ( screenW * 0.8690 ) + 1 , ( screenH * 0.5052 ) + 1 , ( screenW * 0.9480 ) + 1 , ( screenH * 0.5430 ) + 1 , tocolor ( 0 , 0 , 0 , 255 ), 1.05 , "default-bold" , "center" , "center" , false , false , false , false , false )
dxDrawText ( "Wyp?a?" , screenW * 0.8690 , screenH * 0.5052 , screenW * 0.9480 , screenH * 0.5430 , tocolor ( 50 , 50 , 50 , 255 ), 1.05 , "default-bold" , "center" , "center" , false , false , false , false , false )
end
if not cursorPosition ( screenW * 0.8690 , screenH * 0.6029 , screenW * 0.0798 , screenH * 0.0404 ) then -- wplac
dxDrawImage ( screenW * 0.8448 , screenH * 0.5469 , screenW * 0.1340 , screenH * 0.1497 , "przycisk.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false )
dxDrawText ( "Wp?a?" , ( screenW * 0.8697 ) + 1 , ( screenH * 0.6042 ) + 1 , ( screenW * 0.9488 ) + 1 , ( screenH * 0.6432 ) + 1 , tocolor ( 0 , 0 , 0 , 255 ), 1.12 , "default-bold" , "center" , "center" , false , false , false , false , false )
dxDrawText ( "Wp?a?" , screenW * 0.8697 , screenH * 0.6042 , screenW * 0.9488 , screenH * 0.6432 , tocolor ( 255 , 255 , 255 , 255 ), 1.12 , "default-bold" , "center" , "center" , false , false , false , false , false )
else
dxDrawImage ( screenW * 0.8448 , screenH * 0.5469 , screenW * 0.1340 , screenH * 0.1497 , "przycisk.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false )
dxDrawText ( "Wp?a?" , ( screenW * 0.8697 ) + 1 , ( screenH * 0.6042 ) + 1 , ( screenW * 0.9488 ) + 1 , ( screenH * 0.6432 ) + 1 , tocolor ( 0 , 0 , 0 , 255 ), 1.05 , "default-bold" , "center" , "center" , false , false , false , false , false )
dxDrawText ( "Wp?a?" , screenW * 0.8697 , screenH * 0.6042 , screenW * 0.9488 , screenH * 0.6432 , tocolor ( 50 , 50 , 50 , 255 ), 1.05 , "default-bold" , "center" , "center" , false , false , false , false , false )
end
if not cursorPosition ( screenW * 0.7943 , screenH * 0.7839 , screenW * 0.1340 , screenH * 0.0547 ) then -- zamknij
dxDrawImage ( screenW * 0.7526 , screenH * 0.7031 , screenW * 0.2299 , screenH * 0.2070 , "przycisk.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false )
dxDrawText ( "Zamknij" , ( screenW * 0.7950 ) + 1 , ( screenH * 0.7839 ) + 1 , ( screenW * 0.9283 ) + 1 , ( screenH * 0.8385 ) + 1 , tocolor ( 0 , 0 , 0 , 255 ), 1.30 , "default-bold" , "center" , "center" , false , false , false , false , false )
dxDrawText ( "Zamknij" , screenW * 0.7950 , screenH * 0.7839 , screenW * 0.9283 , screenH * 0.8385 , tocolor ( 255 , 255 , 255 , 255 ), 1.30 , "default-bold" , "center" , "center" , false , false , false , false , false )
else
dxDrawImage ( screenW * 0.7526 , screenH * 0.7031 , screenW * 0.2299 , screenH * 0.2070 , "przycisk.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false )
dxDrawText ( "Zamknij" , ( screenW * 0.7950 ) + 1 , ( screenH * 0.7839 ) + 1 , ( screenW * 0.9283 ) + 1 , ( screenH * 0.8385 ) + 1 , tocolor ( 0 , 0 , 0 , 255 ), 1.24 , "default-bold" , "center" , "center" , false , false , false , false , false )
dxDrawText ( "Zamknij" , screenW * 0.7950 , screenH * 0.7839 , screenW * 0.9283 , screenH * 0.8385 , tocolor ( 50 , 50 , 50 , 255 ), 1.24 , "default-bold" , "center" , "center" , false , false , false , false , false )
end
dxDrawText ( "Bankomat" , ( screenW * 0.7694 ) + 1 , ( screenH * 0.3620 ) + 1 , ( screenW * 0.9510 ) + 1 , ( screenH * 0.3997 ) + 1 , tocolor ( 0 , 0 , 0 , 255 ), 1.20 , "default-bold" , "center" , "center" , false , false , false , false , false )
dxDrawText ( "Bankomat" , screenW * 0.7694 , screenH * 0.3620 , screenW * 0.9510 , screenH * 0.3997 , tocolor ( 255 , 255 , 255 , 255 ), 1.20 , "default-bold" , "center" , "center" , false , false , false , false , false )
dxDrawText ( "U?ytkownik: " .. getPlayerName ( localPlayer ): gsub ( "#%x%x%x%x%x%x" , "" ).. "" , ( screenW * 0.7782 ) + 1 , ( screenH * 0.6693 ) + 1 , ( screenW * 0.9422 ) + 1 , ( screenH * 0.7135 ) + 1 , tocolor ( 0 , 0 , 0 , 255 ), 1.20 , "default-bold" , "center" , "center" , false , false , false , false , false )
dxDrawText ( "U?ytkownik: " .. getPlayerName ( localPlayer ): gsub ( "#%x%x%x%x%x%x" , "" ).. "" , screenW * 0.7782 , screenH * 0.6693 , screenW * 0.9422 , screenH * 0.7135 , tocolor ( 255 , 255 , 255 , 255 ), 1.20 , "default-bold" , "center" , "center" , false , false , false , false , false )
end
addEventHandler ( "onClientColShapeHit" , resourceRoot , function( el , md )
if not md or el ~= localPlayer then return end
if panel == false then
addEventHandler ( "onClientRender" , root , BankGUI )
czas = getTickCount ()
panel = true
guiSetVisible ( bw . lbl1 , true )
guiSetVisible ( bw . edt1 , true )
guiSetVisible ( bw . edt2 , true )
showCursor ( true )
guiSetText ( bw . lbl1 , "* Trwa otwieranie konta bankowego..." )
triggerServerEvent ( "onPlayerRequestATMInfo" , resourceRoot )
guiSetInputMode ( "no_binds_when_editing" )
guiSetFont ( bw . lbl2 , font1_money )
guiSetFont ( bw . lbl3 , font1_money )
end
end )
addEvent ( "doFillATMInfo" , true )
addEventHandler ( "doFillATMInfo" , resourceRoot , function( success , balance )
if not success then
guiSetText ( bw . lbl1 , "* Brak polaczenia mysql...." )
return
end
guiSetText ( bw . lbl1 , "Stan Twojego konta:" .. "\n" .. balance .. " PLN" )
guiSetFont ( bw . lbl1 , normalFont )
setElementData ( bw . lbl1 , "balance" , tonumber ( balance ))
guiSetText ( bw . edt2 , 100 > balance and balance or 100 )
if balance > 0 then
end
guiSetText ( bw . edt1 , balance )
end )
addEventHandler ( "onClientPlayerSpawn" , localPlayer , closeATMWin )
function Wplac ( button , state )
if panel and button == "left" and state == "down" then
if cursorPosition ( screenW * 0.8690 , screenH * 0.6029 , screenW * 0.0798 , screenH * 0.0404 ) then
local kwotaee = tonumber ( guiGetText ( bw . edt1 ))
if not kwotaee then return end
local kwota = math . floor ( kwotaee )
if not kwota or kwota < 1 then
outputChatBox ( "* Nieprawid?owa kwota wp?aty!" , 255 , 0 , 0 )
return
end
if kwota > getPlayerMoney () then
outputChatBox ( "* Nie masz tyle got?wki!" , 255 , 0 , 0 )
return
end
triggerServerEvent ( "doATMOperation" , resourceRoot , kwota )
end
end
end
addEventHandler ( "onClientClick" , getRootElement (), Wplac )
function Wyplac ( button , state )
if panel and button == "left" and state == "down" then
if cursorPosition ( screenW * 0.8682 , screenH * 0.5052 , screenW * 0.0798 , screenH * 0.0404 ) then
if not tonumber ( guiGetText ( bw . edt2 )) then return end
local kwotae = tonumber ( guiGetText ( bw . edt2 ))
if not kwotae then return end
local kwota = math . floor ( kwotae )
if not kwota or kwota < 1 then
outputChatBox ( "* Nieprawid?owa kwota wyp?aty!" , 255 , 0 , 0 )
return
end
if getPlayerMoney ()+ kwota > 99999999 then
outputChatBox ( "* Maksymalna ilo?? got?wki kt?r? mo?esz mie? przy sobie to 999999.99 PLN" , 255 , 0 , 0 )
return
end
triggerServerEvent ( "doATMOperation" , resourceRoot , - kwota )
end
end
end
addEventHandler ( "onClientClick" , getRootElement (), Wyplac )
function Zamknij ( button , state )
if panel and button == "left" and state == "down" then
if cursorPosition ( screenW * 0.7943 , screenH * 0.7839 , screenW * 0.1340 , screenH * 0.0547 ) then
panel = false
removeEventHandler ( "onClientRender" , root , BankGUI )
showCursor ( false )
guiSetVisible ( bw . lbl1 , false )
guiSetVisible ( bw . edt1 , false )
guiSetVisible ( bw . edt2 , false )
end
end
end
addEventHandler ( "onClientClick" , getRootElement (), Zamknij )
function cursorPosition ( x , y , w , h )
if ( not isCursorShowing ()) then
return false
end
local mx , my = getCursorPosition ()
local fullx , fully = guiGetScreenSize ()
cursorx , cursory = mx * fullx , my * fully
if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then
return true
else
return false
end
end
bankomaty.lua
addEvent ( "onPlayerRequestATMInfo" , true )
addEventHandler ( "onPlayerRequestATMInfo" , resourceRoot , function()
local dbid = getElementData ( client , "player:uid" )
if not dbid then
triggerClientEvent ( client , "doFillATMInfo" , resourceRoot , false )
return
end
local sr = exports [ "ogrpg-db" ]: dbGet ( "SELECT bank_money FROM ogrpg_users WHERE id=? LIMIT 1" , dbid )
if not sr or #sr < 1 then
triggerClientEvent ( client , "doFillATMInfo" , resourceRoot , false )
return
end
local sr = sr [ 1 ]
triggerClientEvent ( client , "doFillATMInfo" , resourceRoot , true , tonumber ( sr . bank_money ))
end )
addEvent ( "doATMOperation" , true )
addEventHandler ( "doATMOperation" , resourceRoot , function( kwota )
if type ( kwota ) ~= "number" then outputDebugString ( "Blad bankomatu xDDDDD" ) return end
if kwota > 0 and kwota > getPlayerMoney ( client ) then return end -- komunikat bledu po stronie klienta
local dbid = getElementData ( client , "player:uid" )
local sr = exports [ "ogrpg-db" ]: dbGet ( "SELECT `bank_money` FROM `ogrpg_users` WHERE id=? LIMIT 1" , dbid )
if not sr or #sr < 1 then return end
sr = tonumber ( sr [ 1 ]. bank_money )
if not dbid then return end -- nie powinno sie zdarzyc
if kwota > 0 then
if getPlayerMoney ( client )< kwota then return end
takePlayerMoney ( client , kwota )
exports [ "ogrpg-db" ]: dbSet ( "UPDATE ogrpg_users SET bank_money=bank_money+?? WHERE id=? LIMIT 1" , tonumber ( kwota ), dbid )
local sr = exports [ "ogrpg-db" ]: dbGet ( "SELECT `bank_money` FROM `ogrpg_users` WHERE id=? LIMIT 1" , dbid )
if not sr or #sr < 1 then return end
sr = tonumber ( sr [ 1 ]. bank_money )
triggerEvent ( "admin:logs" , root , string . format ( "WPLATA %d DO bankomatu (UID : %d) STAN KONTA %d" , math . abs ( tonumber ( kwota )), dbid , sr ))
-- triggerEvent ( "broadcastCaptionedEvent" , client , getPlayerName ( client ).. " wp?aca pieni?dze do bankomatu" , 3 , 20 , true )
outputChatBox ( "Wp?aci?e?[a?] pieni?dze do bankomatu." , client , 255 , 0 , 100 )
elseif kwota < 0 then
if ( sr < math . abs ( kwota )) then
outputChatBox ( "* Nie masz tyle ?rodk?w na koncie!" , client , 255 , 0 , 0 )
-- triggerClientEvent ( client , "onAnnouncement3" , root , "Nie masz tyle ?rodk?w na koncie!" , 5 )
return
end
exports [ "ogrpg-db" ]: dbSet ( "UPDATE ogrpg_users SET bank_money=bank_money-?? WHERE id=? LIMIT 1" , math . abs ( tonumber ( kwota )), dbid )
local sr = exports [ "ogrpg-db" ]: dbGet ( "SELECT `bank_money` FROM `ogrpg_users` WHERE id=? LIMIT 1" , dbid )
if not sr or #sr < 1 then return end
sr = tonumber ( sr [ 1 ]. bank_money )
triggerEvent ( "admin:logs" , root , string . format ( "WYPLATA %d z bankomatu (UID : %d) STAN KONTA %d" , math . abs ( tonumber ( kwota )), dbid , sr ))
outputChatBox ( "* Wyp?aci?e? pieni?dze z bankomatu." , client , 255 , 80 , 0 )
givePlayerMoney ( client , math . abs ( kwota ))
end
end )