Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bank_c432241149_new
- [lua]local sX,sY=guiGetScreenSize()
- local latoReg9=exports.czcionka:czcionka("latoreg.ttf",9)
- local latoReg10=exports.czcionka:czcionka("latoreg.ttf",10)
- local latoReg11_gui=guiCreateFont("i/Lato_Regular.ttf",11)
- local latoReg11=exports.czcionka:czcionka("latoreg.ttf",11)
- local latoReg12=exports.czcionka:czcionka("latoreg.ttf",12)
- local latoReg14=exports.czcionka:czcionka("latoreg.ttf",14)
- local latoReg16=exports.czcionka:czcionka("latoreg.ttf",16)
- function przecinek(liczba)
- local format = liczba
- while true do
- format, k = string.gsub(format, "^(-?%d+)(%d%d%d)", '%1,%2')
- if ( k==0 ) then
- break
- end
- end
- return format
- end
- local page=nil
- local panelEnabled=false
- local kasa=0
- local okienko=nil
- local antyLag=false
- local karta=nil
- local odbiorca=nil
- local dbidOdbiorcy=0
- local kwotaPrzelewu=0
- local winX,winY,winW,winH=(sX-736)/2,(sY-186)/2,730,220
- local optionH=40
- local iloscOpcji,iloscWidocznych,opcjaPodstawowa=0,5,0
- for i,v in ipairs(getElementsByType("object")) do
- if getElementModel(v)==2942 then setObjectBreakable(v,false) end
- end
- local btn={
- -- WPŁATA
- {typ="akcja",x=(sX-610)/2,y=(sY+250)/2,w=300,h=40,wExtra=0,color={255, 255, 0, 100},text="POWRÓT DO POPRZEDNIEJ STRONY",page="wplata"},
- {typ="akcja",x=(sX+10)/2,y=(sY+250)/2,w=300,h=40,wExtra=0,color={255, 255, 0, 100},text="WPŁAĆ PIENIĄDZE",page="wplata"},
- -- WYPŁATA
- {typ="akcja",x=(sX-610)/2,y=(sY+250)/2,w=300,h=40,wExtra=0,color={255, 255, 0, 100},text="POWRÓT DO POPRZEDNIEJ STRONY",page="wyplata"},
- {typ="akcja",x=(sX+10)/2,y=(sY+250)/2,w=300,h=40,wExtra=0,color={255, 255, 0, 100},text="WYPŁAĆ ŚRODKI",page="wyplata"},
- -- ************************************** BANKOMAT ************************************** --
- -- Menu Główne
- {typ="akcja_1",x=(sX-480)/2,y=(sY-230)/2,w=190,h=190,wExtra=0,color={255, 255, 0, 100},xImg=(sX-410)/2,yImg=(sY-190)/2,wImg=120,hImg=120,linkImg="i/1.png",text="WPŁAĆ PIENIĄDZE",yText=(sY+62)/2,wText=190,hText=30,page="bankomat_start"},
- {typ="akcja_1",x=(sX+100)/2,y=(sY-230)/2,w=190,h=190,wExtra=0,color={255, 255, 0, 100},xImg=(sX+170)/2,yImg=(sY-180)/2,wImg=120,hImg=120,linkImg="i/2.png",text="WYPŁAĆ ŚRODKI",yText=(sY+62)/2,wText=190,hText=30,page="bankomat_start"},
- {typ="akcja",x=(sX-400)/2,y=(sY+250)/2,w=400,h=40,wExtra=0,color={255, 255, 0, 100},text="ZAMKNIJ PANEL",page="bankomat_start"},
- -- ************************************** BANK ************************************** --
- -- Menu Główne
- {typ="akcja_1",x=(sX-770)/2,y=(sY-180)/2,w=120,h=120,wExtra=0,color={255, 255, 0, 100},xImg=(sX-718)/2,yImg=(sY-160)/2,wImg=68,hImg=68,linkImg="i/1.png",text="WPŁAĆ PIENIĄDZE",yText=(sY+12)/2,wText=120,hText=10,page="bank_start"},
- {typ="akcja_1",x=(sX-510)/2,y=(sY-180)/2,w=120,h=120,wExtra=0,color={255, 255, 0, 100},xImg=(sX-458)/2,yImg=(sY-160)/2,wImg=68,hImg=68,linkImg="i/2.png",text="WYPŁAĆ ŚRODKI",yText=(sY+12)/2,wText=120,hText=10,page="bank_start"},
- {typ="akcja_1",x=(sX-250)/2,y=(sY-180)/2,w=120,h=120,wExtra=0,color={255, 255, 0, 100},xImg=(sX-198)/2,yImg=(sY-160)/2,wImg=68,hImg=68,linkImg="i/3.png",text="WYKONAJ\nPRZELEW",yText=(sY+12)/2,wText=120,hText=10,page="bank_start"},
- {typ="akcja_1",x=(sX+270)/2,y=(sY-180)/2,w=120,h=120,wExtra=0,color={255, 255, 0, 100},xImg=(sX+322)/2,yImg=(sY-160)/2,wImg=68,hImg=68,linkImg="i/4.png",text="ZARZĄDZAJ\nKARTĄ",yText=(sY+12)/2,wText=120,hText=10,page="bank_start"},
- {typ="akcja_1",x=(sX+530)/2,y=(sY-180)/2,w=120,h=120,wExtra=0,color={255, 255, 0, 100},xImg=(sX+582)/2,yImg=(sY-160)/2,wImg=68,hImg=68,linkImg="i/5.png",text="HISTORIA\nTRANSAKCJI",yText=(sY+12)/2,wText=120,hText=10,page="bank_start"},
- {typ="akcja",x=(sX-400)/2,y=(sY+250)/2,w=400,h=40,wExtra=0,color={255, 255, 0, 100},text="ZAMKNIJ PANEL",page="bank_start"},
- -- ZARZĄDZANIE KARTĄ
- {typ="akcja",x=(sX-610)/2,y=(sY+250)/2,w=300,h=40,wExtra=0,color={255, 255, 0, 100},text="POWRÓT DO POPRZEDNIEJ STRONY",page="zarzadzaj_karta"},
- {typ="akcja",x=(sX+10)/2,y=(sY+250)/2,w=300,h=40,wExtra=0,color={255, 255, 0, 100},text="",page="zarzadzaj_karta"},
- -- PRZELEW
- {typ="akcja",x=(sX-610)/2,y=(sY+250)/2,w=300,h=40,wExtra=0,color={255, 255, 0, 100},text="POWRÓT DO POPRZEDNIEJ STRONY",page="przelew"},
- {typ="akcja",x=(sX+10)/2,y=(sY+250)/2,w=300,h=40,wExtra=0,color={255, 255, 0, 100},text="WYKONAJ PRZELEW",page="przelew"},
- {typ="akcja",x=(sX-610)/2,y=(sY+250)/2,w=300,h=40,wExtra=0,color={255, 255, 0, 100},text="POWRÓT DO POPRZEDNIEJ STRONY",page="przelew_2"},
- {typ="akcja",x=(sX+10)/2,y=(sY+250)/2,w=300,h=40,wExtra=0,color={255, 255, 0, 100},text="POTWIERDŹ PRZELEW",page="przelew_2"},
- -- HISTORIA PRZELEWÓW
- {typ="akcja",x=(sX-380)/2,y=(sY+300)/2,w=380,h=40,wExtra=0,color={255, 255, 0, 100},text="POWRÓT DO POPRZEDNIEJ STRONY",page="historia_przelewow"},
- {typ="akcja_1",x=(sX+10)/2,y=(sY-180)/2,w=120,h=120,wExtra=0,color={255, 255, 0, 100},xImg=(sX+62)/2,yImg=(sY-160)/2,wImg=68,hImg=68,linkImg="i/3.png",text="PRZELEW\nDO BIZNESU",yText=(sY+12)/2,wText=120,hText=10,page="bank_start"},
- -- PRZELEW BIZNES
- {typ="akcja",x=(sX-610)/2,y=(sY+250)/2,w=300,h=40,wExtra=0,color={255, 255, 0, 100},text="POWRÓT DO POPRZEDNIEJ STRONY",page="przelewbiznes"},
- {typ="akcja",x=(sX+10)/2,y=(sY+250)/2,w=300,h=40,wExtra=0,color={255, 255, 0, 100},text="WYKONAJ PRZELEW",page="przelewbiznes"},
- {typ="akcja",x=(sX-610)/2,y=(sY+250)/2,w=300,h=40,wExtra=0,color={255, 255, 0, 100},text="POWRÓT DO POPRZEDNIEJ STRONY",page="przelewbiznes_2"},
- {typ="akcja",x=(sX+10)/2,y=(sY+250)/2,w=300,h=40,wExtra=0,color={255, 255, 0, 100},text="POTWIERDŹ PRZELEW",page="przelewbiznes_2"},
- }
- local txt_wins={
- {text="BANKOMAT / WPŁATOMAT",color={255,255,255,255},page="bankomat_start"},
- {text="WPŁATOMAT - WPŁACANIE PIENIĘDZY",color={255,255,255,255},page="wplata"},
- {text="BANKOMAT - WYPŁACANIE ŚRODKÓW",color={255,255,255,255},page="wyplata"},
- {text="ODDZIAŁ BANKU - SAN ANDREAS",color={255,255,255,255},page="bank_start"},
- {text="ZARZĄDZANIE KARTĄ",color={255,255,255,255},page="zarzadzaj_karta"},
- {text="PRZELEW BANKOWY",color={255,255,255,255},page="przelew"},
- {text="POTWIERDZENIE PRZELEWU",color={255,255,255,255},page="przelew_2"},
- {text="PRZELEW BANKOWY",color={255,255,255,255},page="przelewbiznes"},
- {text="POTWIERDZENIE PRZELEWU",color={255,255,255,255},page="przelewbiznes_2"},
- {text="HISTORIA DZIAŁAŃ",color={255,255,255,255},page="historia_przelewow"},
- }
- local wplataWyplata=guiCreateEdit((sX-390)/2,(sY+20)/2,440,40,"",false)
- guiSetAlpha(wplataWyplata,0.55)
- guiEditSetMaxLength(wplataWyplata,12)
- guiSetFont(wplataWyplata,latoReg11_gui)
- --guiSetProperty(wplataWyplata,"ValidationString","^[0-9]*$")
- guiSetVisible(wplataWyplata,false)
- local dbid=guiCreateEdit((sX-90)/2,(sY-100)/2,140,40,"",false)
- guiSetAlpha(dbid,0.55)
- guiEditSetMaxLength(dbid,10)
- guiSetFont(dbid,latoReg11_gui)
- --guiSetProperty(dbid,"ValidationString","^[0-9]*$")
- guiSetVisible(dbid,false)
- -- LISTA
- local function myMouseOnList(x,y,w,h)
- if isCursorShowing() and panelEnabled then
- local cX,cY=getCursorPosition()
- cX,cY=cX*sX,cY*sY
- if(cX>x and cX<x+w) and (cY>y and cY<y+h) then return true end
- end
- return false
- end
- local function onClientKey(btn)
- if btn=="mouse_wheel_down" then
- if panelEnabled then
- if iloscOpcji>5 then
- if myMouseOnList(winX,winY,winW,winH) then
- opcjaPodstawowa=opcjaPodstawowa+1
- if opcjaPodstawowa>iloscOpcji-iloscWidocznych then opcjaPodstawowa=iloscOpcji-iloscWidocznych end
- end
- end
- end
- elseif btn=="mouse_wheel_up" then
- if panelEnabled then
- if iloscOpcji>5 then
- if myMouseOnList(winX,winY,winW,winH) then
- opcjaPodstawowa=opcjaPodstawowa-1
- if opcjaPodstawowa<0 then opcjaPodstawowa=0 end
- end
- end
- end
- end
- end
- local function deleteList()
- for i,v in ipairs(btn) do
- if v.typ=="lista" then btn[i]=nil iloscOpcji=0 opcjaPodstawowa=0 end
- end
- end
- local function addButtonsToWindow()
- local cX,cY=getCursorPosition()
- cX,cY=cX*sX,cY*sY
- for i,v in ipairs(btn) do
- if v.page==page then
- if v.typ=="akcja" then
- if(cX>=v.x-(v.wExtra/2) and cX<=v.x-(v.wExtra/2)+v.w+v.wExtra) and (cY>=v.y and cY<=v.y+v.h) then
- if v.wExtra<10 then v.wExtra=v.wExtra+1 end
- if v.color[4]<190 then v.color[4]=v.color[4]+9 end
- else
- if v.wExtra>0 then v.wExtra=v.wExtra-1 end
- if v.color[4]>100 then v.color[4]=v.color[4]-9 end
- end
- dxDrawRectangle(v.x-(v.wExtra/2),v.y,v.w+v.wExtra,v.h,tocolor(v.color[1],v.color[2],v.color[3],v.color[4]),false) -- tło
- dxDrawText(v.text,v.x,v.y,v.x+v.w,v.y+v.h,tocolor(255,255,255,255),1.00,latoReg9,"center","center",false,false,false,false,false) -- opis
- elseif v.typ=="akcja_1" then
- if(cX>=v.x-(v.wExtra/2) and cX<=v.x-(v.wExtra/2)+v.w+v.wExtra) and (cY>=v.y-(v.wExtra/2) and cY<=v.y-(v.wExtra/2)+v.h+v.wExtra) then
- if v.wExtra<10 then v.wExtra=v.wExtra+1 end
- if v.color[4]<190 then v.color[4]=v.color[4]+9 end
- else
- if v.wExtra>0 then v.wExtra=v.wExtra-1 end
- if v.color[4]>100 then v.color[4]=v.color[4]-9 end
- end
- dxDrawRectangle(v.x-(v.wExtra/2),v.y-(v.wExtra/2),v.w+v.wExtra,v.h+v.wExtra,tocolor(v.color[1],v.color[2],v.color[3],v.color[4]),false) -- tło
- dxDrawImage(v.xImg-(v.wExtra/2),v.yImg-(v.wExtra/2),v.wImg+v.wExtra,v.hImg+v.wExtra,v.linkImg,0,0,0,tocolor(255,255,255,255),false) -- ikona
- dxDrawText(v.text,v.x-(v.wExtra/2),v.yText+(v.wExtra/2),v.x-(v.wExtra/2)+v.wText+v.wExtra,v.yText+(v.wExtra/2)+v.hText,tocolor(255,255,255,255),1.00,latoReg9,"center","center",false,false,false,false,false) -- opis
- elseif v.typ=="lista" then
- visible=(v.id-1)-opcjaPodstawowa
- if iloscOpcji<=5 and iloscOpcji>0 then
- if myMouseOnList(winX,winY+(optionH+5)*(v.id-1),winW,optionH) then
- if v.color[4]<190 then v.color[4]=v.color[4]+9 end
- else
- if v.color[4]>100 then v.color[4]=v.color[4]-9 end
- end
- dxDrawRectangle(winX+winW,winY,6,winH,tocolor(255,255,255,190)) -- PASEK SCROLLA
- dxDrawRectangle(winX,winY+(optionH+5)*visible,winW,optionH,tocolor(v.color[1],v.color[2],v.color[3],v.color[4]))
- dxDrawText(v.text[1],winX,winY+(optionH+5)*visible,winX+243,winY+(optionH+5)*visible+41,tocolor(255,255,255,255),1.00,latoReg10,"center","center",false,false,false,false,false)
- dxDrawText(v.text[2],winX+258,winY+(optionH+5)*visible,winX+502,winY+(optionH+5)*visible+41,tocolor(255,255,255,255),1.00,latoReg10,"center","center",false,false,false,false,false)
- dxDrawText(v.text[3],winX+487,winY+(optionH+5)*visible,winX+730,winY+(optionH+5)*visible+41,tocolor(255,255,255,255),1.00,latoReg10,"center","center",false,false,false,false,false)
- elseif iloscOpcji>5 then
- if myMouseOnList(winX,winY+(optionH+5)*visible,winW,optionH) then
- if v.color[4]<190 then v.color[4]=v.color[4]+9 end
- else
- if v.color[4]>100 then v.color[4]=v.color[4]-9 end
- end
- dxDrawRectangle(winX+winW,winY+winH/iloscOpcji*opcjaPodstawowa,6,winH/iloscOpcji*iloscWidocznych,tocolor(255,255,255,190)) -- PASEK SCROLLA
- if v.id>opcjaPodstawowa and v.id<=opcjaPodstawowa+5 then
- dxDrawRectangle(winX,winY+(optionH+5)*visible,winW,optionH,tocolor(v.color[1],v.color[2],v.color[3],v.color[4]))
- dxDrawText(v.text[1],winX,winY+(optionH+5)*visible,winX+243,winY+(optionH+5)*visible+41,tocolor(255,255,255,255),1.00,latoReg10,"center","center",false,false,false,false,false)
- dxDrawText(v.text[2],winX+258,winY+(optionH+5)*visible,winX+502,winY+(optionH+5)*visible+41,tocolor(255,255,255,255),1.00,latoReg10,"center","center",false,false,false,false,false)
- dxDrawText(v.text[3],winX+487,winY+(optionH+5)*visible,winX+730,winY+(optionH+5)*visible+41,tocolor(255,255,255,255),1.00,latoReg10,"center","center",false,false,false,false,false)
- end
- end
- end
- end
- end
- end
- local function panelWindowMain()
- dxDrawRectangle((sX-800)/2,(sY-450)/2,800,450,tocolor(0,0,0,120),false)
- for p=1,59 do
- dxDrawRectangle((sX-800)/2,(sY-450)/2-p+59,p,1,tocolor(255, 255, 0,100),false)
- dxDrawRectangle((sX+800)/2,(sY-450)/2-p+59,-p,1,tocolor(255, 255, 0,100),false)
- dxDrawRectangle((sX-800)/2,(sY+330)/2+p,p,1,tocolor(255, 255, 0,100),false)
- dxDrawRectangle((sX+800)/2-p,(sY+330)/2+p,p,1,tocolor(255, 255, 0,100),false)
- end
- dxDrawRectangle((sX-682)/2,(sY+450)/2-1,682,1,tocolor(255, 255, 0,100),false)
- for p=1,60 do
- dxDrawRectangle((sX-400)/2,(sY-450)/2-p+60,-p,1,tocolor(255, 255, 0,100),false)
- dxDrawRectangle((sX+400)/2,(sY-450)/2-p+60,p,1,tocolor(255, 255, 0,100),false)
- end
- dxDrawRectangle((sX-400)/2,(sY-450)/2,400,60,tocolor(255, 255, 0,100),false)
- for i,v in ipairs(txt_wins) do
- if v.page==page then dxDrawText(v.text,(sX-400)/2,(sY-450)/2,(sX-400)/2+400,(sY-450)/2+60,tocolor(v.color[1],v.color[2],v.color[3],v.color[4]),1.00,latoReg12,"center","center",false,false,false,false,false) end
- end
- end
- local function panelGieldaKonfiskata()
- -- panel
- panelWindowMain()
- if page=="wplata" then
- dxDrawText("W tym miejscu możesz wpłacić pieniądze na swoje konto bankowe.\nAby to zrobić, wpisz odpowiednią kwotę w poniższe okno i kliknij 'WPŁAĆ PIENIĄDZE'.",(sX-400)/2,(sY-250)/2,(sX-400)/2+400,(sY-250)/2+60,tocolor(255,255,255,255),1.00,latoReg10,"center","center",false,false,false,true,false)
- dxDrawText("#008000Stan konta: "..przecinek(kasa).."PLN",(sX-400)/2,(sY-120)/2,(sX-400)/2+400,(sY-120)/2+60,tocolor(255,255,255,255),1.00,latoReg12,"center","center",false,false,false,true,false)
- -- zielone tło
- dxDrawRectangle((sX-500)/2,(sY+10)/2,50,50,tocolor(255, 255, 0,100),false)
- -- białe tło
- dxDrawRectangle((sX-400)/2,(sY+10)/2,450,50,tocolor(255,255,255,100),false)
- -- infolabele
- if string.len(guiGetText(wplataWyplata))==0 then dxDrawText("np. 1000",(sX-376)/2,(sY+10)/2,(sX-376)/2+150,(sY+10)/2+50,tocolor(0,0,0,255),1.00,latoReg11,"left","center",false,false,false,false,false) end
- -- obrazki
- dxDrawImage((sX-490)/2,(sY+20)/2,40,40,"i/1.png",0,0,0,tocolor(255,255,255,200),false)
- elseif page=="wyplata" then
- dxDrawText("W tym miejscu możesz wypłacić pieniądze ze swojego konta bankowego.\nAby to zrobić, wpisz odpowiednią kwotę w poniższe okno i kliknij 'WYPŁAĆ ŚRODKI'.",(sX-400)/2,(sY-250)/2,(sX-400)/2+400,(sY-250)/2+60,tocolor(255,255,255,255),1.00,latoReg10,"center","center",false,false,false,true,false)
- dxDrawText("#008000Stan konta: "..przecinek(kasa).." PLN",(sX-400)/2,(sY-120)/2,(sX-400)/2+400,(sY-120)/2+60,tocolor(255,255,255,255),1.00,latoReg12,"center","center",false,false,false,true,false)
- -- zielone tło
- dxDrawRectangle((sX-500)/2,(sY+10)/2,50,50,tocolor(255, 255, 0,100),false)
- -- białe tło
- dxDrawRectangle((sX-400)/2,(sY+10)/2,450,50,tocolor(255,255,255,100),false)
- -- infolabele
- if string.len(guiGetText(wplataWyplata))==0 then dxDrawText("np. 1000",(sX-376)/2,(sY+10)/2,(sX-376)/2+150,(sY+10)/2+50,tocolor(0,0,0,255),1.00,latoReg11,"left","center",false,false,false,false,false) end
- -- obrazki
- dxDrawImage((sX-490)/2,(sY+20)/2,40,40,"i/2.png",0,0,0,tocolor(255,255,255,200),false)
- elseif page=="zarzadzaj_karta" then
- dxDrawImage((sX-380)/2,(sY-260)/2,380,220,"i/karta.png",0,0,0,tocolor(255,255,255,160),false)
- if not karta then
- dxDrawImage((sX-380)/2,(sY-260)/2,380,220,"i/karta_pasek.png",0,0,0,tocolor(255,255,255,255),false)
- else
- dxDrawText(getPlayerName(localPlayer),((sX-270)/2)+1,((sY+120)/2)+1,(sX-270)/2+1,(sY+120)/2+1,tocolor(159,159,159,255),1.00,latoReg14,"left","center",false,false,false,false,false)
- dxDrawText(getPlayerName(localPlayer),(sX-270)/2,(sY+120)/2,(sX-270)/2,(sY+120)/2,tocolor(90,90,90,255),1.00,latoReg14,"left","center",false,false,false,false,false)
- end
- elseif page=="przelew" then
- dxDrawText("W tym miejscu możesz przelać pieniądze ze swojego konta bankowego na konto innej osoby.\nAby to zrobić, wpisz odpowiednią kwotę oraz SID osoby, do której chcesz wysłać przelew\ni kliknij 'WYKONAJ PRZELEW'.",(sX-400)/2,(sY-250)/2,(sX-400)/2+400,(sY-250)/2+60,tocolor(255,255,255,255),1.00,latoReg10,"center","center",false,false,false,true,false)
- dxDrawText("#008000Stan konta: "..przecinek(kasa).." PLN",(sX-400)/2,(sY+115)/2,(sX-400)/2+400,(sY+115)/2+60,tocolor(255,255,255,255),1.00,latoReg12,"center","center",false,false,false,true,false)
- -- zielone tło
- dxDrawRectangle((sX-200)/2,(sY-110)/2,50,50,tocolor(255, 255, 0,100),false)
- dxDrawRectangle((sX-500)/2,(sY+10)/2,50,50,tocolor(255, 255, 0,100),false)
- -- białe tło
- dxDrawRectangle((sX-100)/2,(sY-110)/2,150,50,tocolor(255,255,255,100),false)
- dxDrawRectangle((sX-400)/2,(sY+10)/2,450,50,tocolor(255,255,255,100),false)
- -- infolabele
- if string.len(guiGetText(dbid))==0 then dxDrawText("SID odbiocy...",(sX-76)/2,(sY-110)/2,(sX-76)/2+150,(sY-110)/2+50,tocolor(0,0,0,255),1.00,latoReg11,"left","center",false,false,false,false,false) end
- if string.len(guiGetText(wplataWyplata))==0 then dxDrawText("np. 1000",(sX-376)/2,(sY+10)/2,(sX-376)/2+150,(sY+10)/2+50,tocolor(0,0,0,255),1.00,latoReg11,"left","center",false,false,false,false,false) end
- -- obrazki
- dxDrawImage((sX-490)/2,(sY+20)/2,40,40,"i/2.png",0,0,0,tocolor(255,255,255,200),false)
- dxDrawImage((sX-190)/2,(sY-100)/2,40,40,"i/6.png",0,0,0,tocolor(255,255,255,200),false)
- elseif page=="przelew_2" then
- dxDrawText("W tym miejscu możesz przelać pieniądze ze swojego konta bankowego na konto wybranego gracza.\nAby to zrobić, wpisz odpowiednią kwotę oraz SID odbiorcy, do którego chcesz wysłać przelew\ni kliknij 'WYKONAJ PRZELEW'.",(sX-400)/2,(sY-250)/2,(sX-400)/2+400,(sY-250)/2+60,tocolor(255,255,255,255),1.00,latoReg10,"center","center",false,false,false,true,false)
- dxDrawText("Stan konta: "..przecinek(kasa).." PLN",(sX-400)/2,(sY+115)/2,(sX-400)/2+400,(sY+115)/2+60,tocolor(255,255,255,255),1.00,latoReg12,"center","center",false,false,false,true,false)
- dxDrawText("#ffff00Nazwa odbiorcy: "..odbiorca.."\nSID odbiorcy: "..dbidOdbiorcy,(sX-200)/2,(sY-110)/2,(sX-200)/2+200,(sY-110)/2+76,tocolor(255,255,255,255),1.00,latoReg12,"center","center",false,false,false,true,false)
- dxDrawText("#ffff00Kwota przelewu: "..przecinek(kwotaPrzelewu).." PLN + 10PLN opłaty za przelew",(sX-500)/2,(sY+10)/2,(sX-500)/2+500,(sY+10)/2+76,tocolor(255,255,255,255),1.00,latoReg12,"center","center",false,false,false,true,false)
- elseif page=="przelewbiznes" then
- dxDrawText("W tym miejscu możesz przelać pieniądze ze swojego konta bankowego na konto wybranego biznesu.\nAby to zrobić, wpisz odpowiednią kwotę oraz ID biznesu, do której chcesz wysłać przelew\ni kliknij 'WYKONAJ PRZELEW'.",(sX-400)/2,(sY-250)/2,(sX-400)/2+400,(sY-250)/2+60,tocolor(255,255,255,255),1.00,latoReg10,"center","center",false,false,false,true,false)
- dxDrawText("#FFFF00Stan konta: "..przecinek(kasa).." PLN",(sX-400)/2,(sY+115)/2,(sX-400)/2+400,(sY+115)/2+60,tocolor(255,255,255,255),1.00,latoReg12,"center","center",false,false,false,true,false)
- -- zielone tło
- dxDrawRectangle((sX-200)/2,(sY-110)/2,50,50,tocolor(255, 255, 0,100),false)
- dxDrawRectangle((sX-500)/2,(sY+10)/2,50,50,tocolor(255, 255, 0,100),false)
- -- białe tło
- dxDrawRectangle((sX-100)/2,(sY-110)/2,150,50,tocolor(255,255,255,100),false)
- dxDrawRectangle((sX-400)/2,(sY+10)/2,450,50,tocolor(255,255,255,100),false)
- -- infolabele
- if string.len(guiGetText(dbid))==0 then dxDrawText("ID biznesu...",(sX-76)/2,(sY-110)/2,(sX-76)/2+150,(sY-110)/2+50,tocolor(0,0,0,255),1.00,latoReg11,"left","center",false,false,false,false,false) end
- if string.len(guiGetText(wplataWyplata))==0 then dxDrawText("np. 1000",(sX-376)/2,(sY+10)/2,(sX-376)/2+150,(sY+10)/2+50,tocolor(0,0,0,255),1.00,latoReg11,"left","center",false,false,false,false,false) end
- -- obrazki
- dxDrawImage((sX-490)/2,(sY+20)/2,40,40,"i/2.png",0,0,0,tocolor(255,255,255,200),false)
- dxDrawImage((sX-190)/2,(sY-100)/2,40,40,"i/6.png",0,0,0,tocolor(255,255,255,200),false)
- elseif page=="przelewbiznes_2" then
- dxDrawText("W tym miejscu możesz przelać pieniądze ze swojego konta bankowego na konto wybranego biznesu.\nAby to zrobić, wpisz odpowiednią kwotę oraz ID biznesu, do której chcesz wysłać przelew\ni kliknij 'WYKONAJ PRZELEW'.",(sX-400)/2,(sY-250)/2,(sX-400)/2+400,(sY-250)/2+60,tocolor(255,255,255,255),1.00,latoReg10,"center","center",false,false,false,true,false)
- dxDrawText("Stan konta: "..przecinek(kasa).." PLN",(sX-400)/2,(sY+115)/2,(sX-400)/2+400,(sY+115)/2+60,tocolor(255,255,255,255),1.00,latoReg12,"center","center",false,false,false,true,false)
- dxDrawText("#ffff00Nazwa firmy odbiorcy: "..odbiorca.."\nID firmy odbiorcy: "..dbidOdbiorcy,(sX-200)/2,(sY-110)/2,(sX-200)/2+200,(sY-110)/2+76,tocolor(255,255,255,255),1.00,latoReg12,"center","center",false,false,false,true,false)
- dxDrawText("#ffff00Kwota przelewu: "..kwotaPrzelewu.."PLN + 10PLN opłaty za przelew",(sX-500)/2,(sY+10)/2,(sX-500)/2+500,(sY+10)/2+76,tocolor(255,255,255,255),1.00,latoReg12,"center","center",false,false,false,true,false)
- elseif page=="historia_przelewow" then
- dxDrawRectangle((sX-750)/2,(sY-296)/2,750,50,tocolor(255, 255, 0,100),false)
- dxDrawRectangle((sX-750)/2,(sY+264)/2,750,2,tocolor(255, 255, 0,100),false)
- dxDrawRectangle((sX-750)/2,(sY-196)/2,2,230,tocolor(255, 255, 0,100),false)
- dxDrawRectangle((sX+746)/2,(sY-196)/2,2,230,tocolor(255, 255, 0,100),false)
- dxDrawText("DATA WYKONANIA",(sX-736)/2,(sY-296)/2,(sX-736)/2+243,(sY-296)/2+50,tocolor(255,255,255,255),1.00,latoReg10,"center","center",false,false,false,false,false)
- dxDrawText("OPIS",(sX-250)/2,(sY-296)/2,(sX-250)/2+244,(sY-296)/2+50,tocolor(255,255,255,255),1.00,latoReg10,"center","center",false,false,false,false,false)
- dxDrawText("DZIAŁANIE",(sX+238)/2,(sY-296)/2,(sX+238)/2+243,(sY-296)/2+50,tocolor(255,255,255,255),1.00,latoReg10,"center","center",false,false,false,false,false)
- end
- addButtonsToWindow()
- end
- addEvent("panelBanku_c",true)
- addEventHandler("panelBanku_c",resourceRoot,function(cmd,d,d2,d3)
- if cmd=="showWindow" then
- if d then
- if not d2 then return end
- if panelEnabled then return end
- addEventHandler("onClientRender",root,panelGieldaKonfiskata)
- addEventHandler("onClientClick",root,onClientClick)
- addEventHandler("onClientKey",root,onClientKey)
- panelEnabled=true
- kasa=d2
- okienko=d3
- karta=getElementData(localPlayer,"bank:karta")
- page=okienko.."_start"
- showCursor(true,false)
- guiSetInputMode("no_binds")
- setElementData(localPlayer,"3dtext_status",false)
- elseif not d then
- removeEventHandler("onClientRender",root,panelGieldaKonfiskata)
- removeEventHandler("onClientClick",root,onClientClick)
- removeEventHandler("onClientKey",root,onClientKey)
- panelEnabled=false
- page="bankomat_start"
- okienko=nil
- karta=nil
- showCursor(false,false)
- guiSetInputMode("allow_binds")
- setElementData(localPlayer,"3dtext_status",true)
- end
- elseif cmd=="odswiezPanel" then
- if page=="wplata" or page=="wyplata" then kasa=d
- elseif page=="zarzadzaj_karta" then
- karta=d
- antyLag=false
- if not karta then btn[15].text="WYRÓB NOWĄ KARTĘ (2,500,000PLN)" else btn[15].text="DEZAKTYWUJ KARTĘ" end
- elseif page=="przelew_2" then
- page="przelew"
- guiSetVisible(wplataWyplata,true)
- guiSetVisible(dbid,true)
- kasa=d
- odbiorca=nil
- dbidOdbiorcy=0
- kwotaPrzelewu=0
- elseif page=="przelewbiznes_2" then
- page="przelewbiznes"
- guiSetVisible(wplataWyplata,true)
- guiSetVisible(dbid,true)
- kasa=d
- odbiorca=nil
- dbidOdbiorcy=0
- kwotaPrzelewu=0
- end
- elseif cmd=="przelewaniePieniedzy_2" then
- guiSetText(wplataWyplata,"")
- guiSetText(dbid,"")
- guiSetVisible(wplataWyplata,false)
- guiSetVisible(dbid,false)
- odbiorca=d
- kwotaPrzelewu=d2
- dbidOdbiorcy=d3
- page="przelew_2"
- elseif cmd=="przelewaniePieniedzy_4" then
- guiSetText(wplataWyplata,"")
- guiSetText(dbid,"")
- guiSetVisible(wplataWyplata,false)
- guiSetVisible(dbid,false)
- odbiorca=d
- kwotaPrzelewu=d2
- dbidOdbiorcy=d3
- page="przelewbiznes_2"
- elseif cmd=="unlock" then
- antyLag=false
- elseif cmd=="pobierzHistorie" then
- for i,v in ipairs(d) do
- if v.typ=="wplata" then table.insert(btn,{typ="lista",id=i,text={v.data,"kwota: "..v.kwota.."PLN","WPŁATA"},page="historia_przelewow",color={255, 79, 10,100}})
- elseif v.typ=="wyplata" then table.insert(btn,{typ="lista",id=i,text={v.data,"kwota: "..v.kwota.."PLN","WYPŁATA"},page="historia_przelewow",color={255, 79, 10,100}})
- elseif v.typ=="przelew" then table.insert(btn,{typ="lista",id=i,text={v.data,"DO: "..v.odbiorca.."("..v.dbid_o.."), kwota: "..v.kwota.." PLN","PRZELEW"},page="historia_przelewow",color={255, 79, 10,100}})
- else
- if v.dbid_n==getElementData(localPlayer,"player:sid") then table.insert(btn,{typ="lista",id=i,text={v.data,"DO: "..v.odbiorca.."("..v.dbid_o.."), kwota: "..v.kwota.."PLN","PRZELEW"},page="historia_przelewow",color={255, 79, 10,100}})
- elseif v.dbid_o==getElementData(localPlayer,"player:sid") then table.insert(btn,{typ="lista",id=i,text={v.data,"OD: "..v.nadawca.."("..v.dbid_n.."), kwota: "..v.kwota.."PLN","PRZELEW"},page="historia_przelewow",color={255, 79, 10,100}}) end
- end
- iloscOpcji=iloscOpcji+1
- end
- end
- end)
- -- PRZYCISKI (CLICK)
- function onClientClick(_,state,x,y)
- -- zabezpieczenie przed aktywacją przycisków poza panelem
- if not panelEnabled then return end
- -- aktywacja przycisków
- if state=="up" then
- local bClick=nil
- for i,v in ipairs(btn) do
- if v.page==page and not antyLag then
- if v.typ=="akcja" then
- if(x>=v.x-(v.wExtra/2) and x<=v.x-(v.wExtra/2)+v.w+v.wExtra) and (y>=v.y and y<=v.y+v.h) then
- bClick=v
- v.color[4]=100
- v.wExtra=0
- end
- elseif v.typ=="akcja_1" then
- if(x>=v.x-(v.wExtra/2) and x<=v.x-(v.wExtra/2)+v.w+v.wExtra) and (y>=v.y-(v.wExtra/2) and y<=v.y-(v.wExtra/2)+v.h+v.wExtra) then
- bClick=v
- v.color[4]=100
- v.wExtra=0
- end
- end
- end
- end
- if not bClick then return end
- if bClick.text=="ZAMKNIJ PANEL" then triggerEvent("panelBanku_c",resourceRoot,"showWindow",false) page=nil end
- if page=="bankomat_start" or page=="bank_start" then
- if bClick.text=="WPŁAĆ PIENIĄDZE" then
- page="wplata"
- guiSetVisible(wplataWyplata,true)
- elseif bClick.text=="WYPŁAĆ ŚRODKI" then
- page="wyplata"
- guiSetVisible(wplataWyplata,true)
- end
- end
- if page=="bank_start" then
- if bClick.text=="ZARZĄDZAJ\nKARTĄ" then
- if not karta then btn[15].text="WYRÓB NOWĄ KARTĘ (2,500,000 PLN)" else btn[15].text="DEZAKTYWUJ KARTĘ" end
- page="zarzadzaj_karta"
- elseif bClick.text=="WYKONAJ\nPRZELEW" then
- page="przelew"
- guiSetVisible(wplataWyplata,true)
- guiSetVisible(dbid,true)
- elseif bClick.text=="PRZELEW\nDO BIZNESU" then
- page="przelewbiznes"
- guiSetVisible(wplataWyplata,true)
- guiSetVisible(dbid,true)
- elseif bClick.text=="HISTORIA\nTRANSAKCJI" then
- triggerServerEvent("panelBanku",resourceRoot,"pobierzHistorie")
- page="historia_przelewow"
- end
- elseif page=="wplata" then
- if bClick.text=="WPŁAĆ PIENIĄDZE" then
- if string.len(guiGetText(wplataWyplata))==0 then outputChatBox("Wpisz kwotę, którą chcesz wpłacić na konto bankowe.") return end
- if tonumber(guiGetText(wplataWyplata)) then
- triggerServerEvent("panelBanku",resourceRoot,"wplacaniePieniedzy",tonumber(guiGetText(wplataWyplata)),okienko)
- guiSetText(wplataWyplata,"")
- else outputChatBox("Nieprawidłowy format.") end
- elseif bClick.text=="POWRÓT DO POPRZEDNIEJ STRONY" then
- guiSetVisible(wplataWyplata,false)
- guiSetText(wplataWyplata,"")
- page=okienko.."_start"
- end
- elseif page=="wyplata" then
- if bClick.text=="WYPŁAĆ ŚRODKI" then
- if string.len(guiGetText(wplataWyplata))==0 then outputChatBox("Wpisz kwotę, którą chcesz wypłacić z konta bankowego.") return end
- if tonumber(guiGetText(wplataWyplata)) then
- if tonumber(guiGetText(wplataWyplata))<(0) then outputChatBox("Nieprawidłowy format.") return end
- local kasa = split(guiGetText(wplataWyplata), "")
- if kasa[2] then if string.len(kasa[2]) > 2 then outputChatBox("Max 2 znaki po przecinku.") return end end
- triggerServerEvent("panelBanku",resourceRoot,"wyplacaniePieniedzy",tonumber(guiGetText(wplataWyplata)),okienko)
- guiSetText(wplataWyplata,"")
- else outputChatBox("Nieprawidłowy format.") end
- elseif bClick.text=="POWRÓT DO POPRZEDNIEJ STRONY" then
- guiSetVisible(wplataWyplata,false)
- guiSetText(wplataWyplata,"")
- page=okienko.."_start"
- end
- elseif page=="zarzadzaj_karta" then
- if bClick.text=="WYRÓB NOWĄ KARTĘ (2,500,000 PLN)" or bClick.text=="DEZAKTYWUJ KARTĘ" then antyLag=true triggerServerEvent("panelBanku",resourceRoot,"wyrabianieKarty",okienko)
- elseif bClick.text=="POWRÓT DO POPRZEDNIEJ STRONY" then page=okienko.."_start" end
- elseif page=="przelew" then
- if bClick.text=="WYKONAJ PRZELEW" then
- if string.len(guiGetText(dbid))==0 then outputChatBox("Wpisz SID odbiorcy.") return end
- if string.len(guiGetText(wplataWyplata))==0 then outputChatBox("Wpisz kwotę przelewu.") return end
- if tonumber(guiGetText(wplataWyplata)) then
- if tonumber(guiGetText(wplataWyplata))<100 then outputChatBox("Przelew bankowy można wykonać na kwotę od 100PLN.") return end
- triggerServerEvent("panelBanku",resourceRoot,"przelewaniePieniedzy",tonumber(guiGetText(dbid)),tonumber(guiGetText(wplataWyplata)))
- else outputChatBox("Nieprawidłowy format.") end
- elseif bClick.text=="POWRÓT DO POPRZEDNIEJ STRONY" then
- guiSetVisible(wplataWyplata,false)
- guiSetVisible(dbid,false)
- guiSetText(wplataWyplata,"")
- guiSetText(dbid,"")
- page=okienko.."_start"
- end
- elseif page=="przelew_2" then
- if bClick.text=="POTWIERDŹ PRZELEW" then triggerServerEvent("panelBanku",resourceRoot,"przelewaniePieniedzy_2",dbidOdbiorcy,odbiorca,kwotaPrzelewu)
- elseif bClick.text=="POWRÓT DO POPRZEDNIEJ STRONY" then
- odbiorca=nil
- dbidOdbiorcy=0
- kwotaPrzelewu=0
- guiSetVisible(wplataWyplata,true)
- guiSetVisible(dbid,true)
- page="przelew"
- end
- elseif page=="przelewbiznes" then
- if bClick.text=="WYKONAJ PRZELEW" then
- if string.len(guiGetText(dbid))==0 then outputChatBox("Wpisz ID biznesu.") return end
- if string.len(guiGetText(wplataWyplata))==0 then outputChatBox("Wpisz kwotę przelewu.") return end
- if tonumber(guiGetText(wplataWyplata)) then
- if tonumber(guiGetText(wplataWyplata))<100 then outputChatBox("Przelew bankowy można wykonać na kwotę od 100PLN.") return end
- triggerServerEvent("panelBanku",resourceRoot,"przelewaniePieniedzy_3",tonumber(guiGetText(dbid)),tonumber(guiGetText(wplataWyplata)))
- else outputChatBox("Nieprawidłowy format.") end
- elseif bClick.text=="POWRÓT DO POPRZEDNIEJ STRONY" then
- guiSetVisible(wplataWyplata,false)
- guiSetVisible(dbid,false)
- guiSetText(wplataWyplata,"")
- guiSetText(dbid,"")
- page=okienko.."_start"
- end
- elseif page=="przelewbiznes_2" then
- if bClick.text=="POTWIERDŹ PRZELEW" then triggerServerEvent("panelBanku",resourceRoot,"przelewaniePieniedzy_4",dbidOdbiorcy,odbiorca,kwotaPrzelewu)
- elseif bClick.text=="POWRÓT DO POPRZEDNIEJ STRONY" then
- odbiorca=nil
- dbidOdbiorcy=0
- kwotaPrzelewu=0
- guiSetVisible(wplataWyplata,true)
- guiSetVisible(dbid,true)
- page="przelewbiznes"
- end
- elseif page=="historia_przelewow" then
- if bClick.text=="POWRÓT DO POPRZEDNIEJ STRONY" then
- page=okienko.."_start"
- deleteList()
- end
- end
- end
- end
- -- Zabezpieczenie przez zbugowaniem gracza ze statusem "no_binds"
- addEventHandler("onClientResourceStop",resourceRoot,function()
- if panelEnabled then
- panelEnabled=false
- guiSetInputMode("allow_binds")
- setElementData(localPlayer,"3dtext_status",true)
- end
- end)[/lua]
- oraz bank7895542_new
- [lua]local banks={
- {pozATM={1465.83, -1749.91, 15.45,180},typ="bankomat"},
- {pozATM={-2665.41, -12.46, 6.13,-90},typ="bankomat"},
- {pozATM={-2058.65, -101.89, 35.17,-535},typ="bankomat"},
- {pozATM={-1894.82, -510.55, 24.98,0},typ="bankomat"},
- {pozATM={-2032.98, 164.66, 28.84,90},typ="bankomat"},
- {pozATM={-1974.29, 309.36, 35.17,0},typ="bankomat"},
- {pozATM={-1798.35, 1200.63, 25.12,0},typ="bankomat"},
- {pozATM={-1653.16, 1206.55, 7.25,-535},typ="bankomat"},
- {pozATM={-2715.56, 223.22, 4.33,90},typ="bankomat"},
- {pozATM={-1851.98, 1421.64, 7.18,-90},typ="bankomat"},
- {pozATM={-1711.88, -64.47, 3.55,-50},typ="bankomat"},
- {pozATM={-2930.80, 457.34, 4.91,88},typ="bankomat"},
- {pozATM={-2297.92, -172.53, 35.32,127},typ="bankomat"},
- {pozATM={-1561.48, 132.19, 3.55,135},typ="bankomat"},
- {pozATM={-1693.15, 415.17, 7.18,45},typ="bankomat"},
- {pozATM={-2374.56, 905.03, 45.45,270},typ="bankomat"},
- {pozATM={-1982.63, 620.47, 35.17,360},typ="bankomat"},
- {pozATM={-1745.74, 771.45, 24.89,360},typ="bankomat"},
- {pozATM={-924.91, -519.22, 25.95,470},typ="bankomat"},
- {pozATM={-1061.09, -1192.22, 129.22,90},typ="bankomat"},
- {pozATM={-2670.92, 636.53, 14.45,90},typ="bankomat"},
- {pozATM={-1625.36, 717.60, 14.61,90},typ="bankomat"},
- {pozATM={-1018.41, -698.41, 32.01,90},typ="bankomat"},
- {pozATM={-2203.24, -2332.91, 30.63,230},typ="bankomat"},
- {pozATM={-2354.78, -1632.96, 486.01,90},typ="bankomat"},
- {pozATM={-2338.77, -1636.21, 484.75,90},typ="bankomat"},
- {pozATM={2798.90, 973.50, 10.75,0},typ="bankomat"},
- {pozATM={2117.71, 2362.37, 10.82,90},typ="bankomat"},
- {pozATM={1624.54, -1135.28, 23.91,90},typ="bankomat"},
- {poz={-3418.92, 402.67, 17.91},typ="bank",int=0,dim=69},
- }
- for i,v in ipairs(banks) do
- if v.typ=="bankomat" then
- v.atm=createObject(2942,v.pozATM[1],v.pozATM[2],v.pozATM[3]-0.4,0,0,v.pozATM[4])
- setElementDimension(v.atm,v.dim or 0)
- setElementInterior(v.atm,v.int or 0)
- local x,y,z=getElementPosition(v.atm)
- local _,_,rz=getElementRotation(v.atm)
- local rrz=math.rad(rz)
- local px=x-(0.8*math.sin(-rrz))
- local py=y-(0.8*math.cos(-rrz))
- v.marker=createMarker(px,py,v.pozATM[3]-1,'cylinder',1.1, 255, 255, 0)
- setElementDimension(v.marker,v.dim or 0)
- setElementInterior(v.marker,v.int or 0)
- local t=createElement("text")
- setElementPosition(t,v.pozATM[1],v.pozATM[2],v.pozATM[3]-0.05)
- setElementData(t,"name","Bankomat 24/7")
- setElementDimension(t,v.dim or 0)
- setElementInterior(t,v.int or 0)
- else
- v.marker=createMarker(v.poz[1],v.poz[2],v.poz[3]-1,'cylinder',1.1,255, 255, 0)
- setElementDimension(v.marker,v.dim or 0)
- setElementInterior(v.marker,v.int or 0)
- local t=createElement("text")
- setElementPosition(t,v.poz[1],v.poz[2],v.poz[3]-0.05)
- setElementData(t,"name","MazeBank\nChmura RPG")
- setElementDimension(t,v.dim or 0)
- setElementInterior(t,v.int or 0)
- end
- end
- function ifMandaty(plr)
- if not plr then return end
- if getElementData(plr,"player:mandate")>=500000 then return true
- else return false end
- end
- addEventHandler("onMarkerHit",resourceRoot,function(plr,dim)
- if not dim then return end
- if getElementType(plr)=="player" then
- if isPedInVehicle(plr) then return end
- local z_m=nil
- for i,v in ipairs(banks) do
- if v.marker==source then z_m=v end
- end
- if not z_m then return end
- for i,v in ipairs(banks) do
- if v.marker==source then
- if v.typ=="bankomat" then
- if not getElementData(plr,"bank:karta") then
- outputChatBox("Nie posiadasz karty bankomatowo-płatniczej!",plr)
- outputChatBox("Udaj się do najbliższej placówki banku, aby ją nabyć.",plr)
- return
- end
- end
- local zap=exports["DB2"]:pobierzWyniki("SELECT bank_money FROM pystories_users WHERE id=?",getElementData(plr,"player:sid"))
- if not zap then return end
- triggerClientEvent(plr,"panelBanku_c",resourceRoot,"showWindow",true,tostring(tonumber(zap.bank_money)),v.typ)
- end
- end
- end
- end)
- addEvent("panelBanku",true)
- addEventHandler("panelBanku",resourceRoot,function(cmd,d,d2,d3,d4)
- if cmd=="wplacaniePieniedzy" then
- if(d>0) then
- if (d)<=getPlayerMoney(client) then
- local kwota=tostring(d)
- kwota=(kwota)
- kwota=kwota
- takePlayerMoney(client,kwota)
- exports["pystories-db"]:dbSet("UPDATE pystories_users SET bank_money=bank_money+? WHERE id=? LIMIT 1",kwota,getElementData(client,"player:sid"))
- exports["pystories-db"]:dbSet("INSERT INTO psrpg_przelewy_bank SET typ=?,dbid_n=?,nadawca=?,kwota=?, data=NOW()","wplata",getElementData(client,"player:sid"),getPlayerName(client),kwota)
- local zap=exports["DB2"]:pobierzWyniki("SELECT bank_money FROM pystories_users WHERE id=? LIMIT 1",getElementData(client,"player:sid"))
- if not zap then return end
- triggerClientEvent(client,"panelBanku_c",resourceRoot,"odswiezPanel",tonumber(zap.bank_money))
- if d2=="bank" then --exports["es-logi"]:outputUcho("BANK WPLATA: "..getPlayerName(client).." kwota: "..string.format("%.2f",kwota/100).." PLN")
- else --exports["es-logi"]:outputUcho("BANKOMAT WPLATA: "..getPlayerName(client).." kwota: "..string.format("%.2f",kwota/100).." PLN") end
- end
- outputChatBox("Wpłata została wykonana pomyślnie.",client)
- else outputChatBox("Nie posiadasz tyle gotówki.",client) end
- else outputChatBox("Kwota musi być większa niż 0 PLN.",client) end
- elseif cmd=="wyplacaniePieniedzy" then
- if(d>0) then
- local zap=exports["DB2"]:pobierzWyniki("SELECT bank_money FROM pystories_users WHERE id=? LIMIT 1",getElementData(client,"player:sid"))
- if not zap then return end
- local kwota=d
- kwota=(kwota)
- if(zap.bank_money>=kwota) then
- if (getPlayerMoney(client)+kwota>99999999) then outputChatBox("Możesz mieć przy sobie maksymalnie 99,999,999 PLN.",client)
- else
- givePlayerMoney(client,kwota)
- exports["pystories-db"]:dbSet("UPDATE pystories_users SET bank_money=bank_money-? WHERE id=? LIMIT 1",kwota,getElementData(client,"player:sid"))
- exports["pystories-db"]:dbSet("INSERT INTO psrpg_przelewy_bank SET typ=?,dbid_n=?,nadawca=?,kwota=?, data=NOW()","wyplata",getElementData(client,"player:sid"),getPlayerName(client),kwota)
- triggerClientEvent(client,"panelBanku_c",resourceRoot,"odswiezPanel",tonumber((zap.bank_money-kwota)))
- outputChatBox("Wypłata została wykonana pomyślnie.",client)
- if d2=="bank" then --exports["es-logi"]:outputUcho("BANK WYPLATA: "..getPlayerName(client).." kwota: "..string.format("%.2f",kwota/100).." PLN")
- else --exports["es-logi"]:outputUcho("BANKOMAT WYPLATA: "..getPlayerName(client).." kwota: "..string.format("%.2f",kwota/100).." PLN") end
- end
- end
- else outputChatBox("Nie posiadasz takiej ilości środków na koncie.",client) end
- else outputChatBox("Kwota musi być większa niż 0PLN.",client) end
- zap=nil
- elseif cmd=="wyrabianieKarty" then
- if not getElementData(client,"bank:karta") then
- if getPlayerMoney(client)<(2500000) then
- outputChatBox("Nie posiadasz tyle gotówki - 2,500,000PLN.",client)
- triggerClientEvent(client,"panelBanku_c",resourceRoot,"unlock")
- return
- end
- takePlayerMoney(client,(2500000))
- setElementData(client,"bank:karta",true)
- exports["pystories-db"]:dbSet("UPDATE pystories_users SET karta_bank='tak' WHERE id=?",getElementData(client,"player:sid"))
- outputChatBox("Wyrobiono kartę bankomatowo-płatniczą.",client)
- outputChatBox("Od teraz możesz wpłacać i wypłacać gotówkę w bankomatach.",client)
- --exports["es-logi"]:outputUcho("BANK KARTA: "..getPlayerName(client).." aktywuje nową kartę bankomatowo-płatniczą za 150PLN.")
- zap=nil
- else
- removeElementData(client,"bank:karta")
- exports["pystories-db"]:dbSet("UPDATE pystories_users SET karta_bank=NULL WHERE id=?",getElementData(client,"player:sid"))
- outputChatBox("Dezaktywowano kartę bankomatowo-płatniczą.",client)
- outputChatBox("Nie możesz już wpłacać i wypłacać gotówki poprzez bankomaty.",client)
- --exports["es-logi"]:outputUcho("BANK KARTA: "..getPlayerName(client).." dezaktywuje swoją kartę bankomatowo-płatniczą.")
- zap=nil
- end
- triggerClientEvent(client,"panelBanku_c",resourceRoot,"odswiezPanel",getElementData(client,"bank:karta"))
- elseif cmd=="przelewaniePieniedzy" then
- local odbiorca=exports["DB2"]:pobierzWyniki("SELECT login FROM pystories_users WHERE id=? LIMIT 1",d)
- if odbiorca then
- local kwota=d2
- kwota=(kwota)
- triggerClientEvent(client,"panelBanku_c",resourceRoot,"przelewaniePieniedzy_2",odbiorca.login,kwota,d)
- else outputChatBox("Nie znaleziono gracza w bazie danych o takim ID.",client) end
- elseif cmd=="przelewaniePieniedzy_2" then
- local kwota=d3
- local zap=exports["DB2"]:pobierzWyniki("SELECT bank_money FROM pystories_users WHERE id=?",getElementData(client,"player:sid"))
- if zap.bank_money>=kwota then
- if not ifMandaty(client) then
- exports["pystories-db"]:dbSet("UPDATE pystories_users SET bank_money=bank_money-? WHERE id=? LIMIT 1",kwota,getElementData(client,"player:sid"))
- exports["pystories-db"]:dbSet("UPDATE pystories_users SET bank_money=bank_money+? WHERE id=? LIMIT 1",kwota,d)
- --exports["es-logi"]:outputUcho("BANK PRZELEW: "..getPlayerName(client).." do DBIDu: "..d.." kwota: "..string.format("%.2f",kwota/100).." PLN")
- if kwota then exports["pystories-db"]:dbSet("INSERT INTO psrpg_przelewy_bank SET typ=?,dbid_o=?,nadawca=?,dbid_n=?,odbiorca=?,kwota=?, data=NOW()","przelew",getElementData(client,"player:sid"),getPlayerName(client),d,d2,kwota) end
- outputChatBox("Przelew wykonany pomyślnie.",client)
- else outputChatBox("Bank wstrzymał twój przelew, ponieważ masz nieopłacone mandaty.",client) end
- else outputChatBox("Brak wystarczającej ilości środków na koncie.",client) end
- local zap=exports["DB2"]:pobierzWyniki("SELECT bank_money FROM pystories_users WHERE id=?",getElementData(client,"player:sid"))
- triggerClientEvent(client,"panelBanku_c",resourceRoot,"odswiezPanel",zap.bank_money)
- elseif cmd=="przelewaniePieniedzy_3" then
- local odbiorca=exports["DB2"]:pobierzWyniki("SELECT nazwa FROM es_biznesy_stacje_paliw WHERE id=? LIMIT 1",d)
- if odbiorca then
- local kwota=d2
- kwota=(kwota)
- triggerClientEvent(client,"panelBanku_c",resourceRoot,"przelewaniePieniedzy_4",odbiorca.nazwa,kwota,d)
- else outputChatBox("Nie znaleziono biznesu w bazie danych o takim ID.",client) end
- elseif cmd=="przelewaniePieniedzy_4" then
- local kwota=d3
- local zap=exports["DB2"]:pobierzWyniki("SELECT bank_money FROM pystories_users WHERE id=?",getElementData(client,"player:sid"))
- if zap.kasa_bank>=kwota then
- if not ifMandaty(client) then
- exports["pystories-db"]:dbSet("UPDATE pystories_users SET bank_money=bank_money-? WHERE id=? LIMIT 1",kwota,getElementData(client,"player:sid"))
- exports["pystories-db"]:dbSet("UPDATE es_biznesy_stacje_paliw SET kasa=kasa+? WHERE id=? LIMIT 1",kwota,d)
- exports["pystories-db"]:dbSet("INSERT INTO es_biznesy_stacje_paliw_historia SET bid=?,typ=?,data=NOW(),operacja=?",d,"zarobek",kwota,getPlayerName(client))
- --exports["es-logi"]:outputUcho("BANK PRZELEW BIZNES: "..getPlayerName(client).." do biznesu: "..d2.."[ID:"..d.."] kwota: "..string.format("%.2f",kwota/100).." PLN")
- if kwota>=10000 then exports["pystories-db"]:dbSet("INSERT INTO psrpg_przelewy_bank SET typ=?,dbid_o=?,nadawca=?,dbid_n=?,odbiorca=?,kwota=?","przelew",getElementData(client,"player:sid"),getPlayerName(client),d,d2,kwota) end
- exports["es-komunikaty"]:komunikat("Przelew wykonany pomyślnie.",client)
- else exports["es-komunikaty"]:komunikat("Bank wstrzymał twój przelew, ponieważ masz nieopłacone mandaty.",client) end
- else exports["es-komunikaty"]:komunikat("Brak wystarczającej ilości środków na koncie.",client) end
- local zap=exports["pystories-db"]:dbSet("SELECT bank_money FROM pystories_users WHERE id=?",getElementData(client,"player:sid"))
- triggerClientEvent(client,"panelBanku_c",resourceRoot,"odswiezPanel",zap.kasa_ban)
- elseif cmd=="pobierzHistorie" then
- local zap=exports["pystories-db"]:dbSet("SELECT * FROM psrpg_przelewy_bank WHERE dbid_n=? OR dbid_o=? ORDER BY data DESC",getElementData(client,"player:sid"),getElementData(client,"player:sid"))
- if not zap then return end
- triggerClientEvent(client,"panelBanku_c",resourceRoot,"pobierzHistorie",zap)
- zap=nil
- end
- end)[/lua]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement