Advertisement
Kezoto

Untitled

Jul 31st, 2020
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 43.80 KB | None | 0 0
  1. bank_c432241149_new
  2.  
  3. [lua]local sX,sY=guiGetScreenSize()
  4. local latoReg9=exports.czcionka:czcionka("latoreg.ttf",9)
  5. local latoReg10=exports.czcionka:czcionka("latoreg.ttf",10)
  6. local latoReg11_gui=guiCreateFont("i/Lato_Regular.ttf",11)
  7. local latoReg11=exports.czcionka:czcionka("latoreg.ttf",11)
  8. local latoReg12=exports.czcionka:czcionka("latoreg.ttf",12)
  9. local latoReg14=exports.czcionka:czcionka("latoreg.ttf",14)
  10. local latoReg16=exports.czcionka:czcionka("latoreg.ttf",16)
  11.  
  12. function przecinek(liczba)
  13. local format = liczba
  14. while true do
  15. format, k = string.gsub(format, "^(-?%d+)(%d%d%d)", '%1,%2')
  16. if ( k==0 ) then
  17. break
  18. end
  19. end
  20. return format
  21. end
  22.  
  23. local page=nil
  24. local panelEnabled=false
  25. local kasa=0
  26. local okienko=nil
  27. local antyLag=false
  28. local karta=nil
  29.  
  30. local odbiorca=nil
  31. local dbidOdbiorcy=0
  32. local kwotaPrzelewu=0
  33. local winX,winY,winW,winH=(sX-736)/2,(sY-186)/2,730,220
  34. local optionH=40
  35. local iloscOpcji,iloscWidocznych,opcjaPodstawowa=0,5,0
  36.  
  37. for i,v in ipairs(getElementsByType("object")) do
  38. if getElementModel(v)==2942 then setObjectBreakable(v,false) end
  39. end
  40.  
  41. local btn={
  42. -- WPŁATA
  43. {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"},
  44. {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"},
  45. -- WYPŁATA
  46. {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"},
  47. {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"},
  48.  
  49. -- ************************************** BANKOMAT ************************************** --
  50. -- Menu Główne
  51. {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"},
  52. {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"},
  53. {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"},
  54.  
  55. -- ************************************** BANK ************************************** --
  56. -- Menu Główne
  57. {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"},
  58. {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"},
  59. {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"},
  60. {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"},
  61. {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"},
  62. {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"},
  63.  
  64. -- ZARZĄDZANIE KARTĄ
  65. {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"},
  66. {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"},
  67.  
  68. -- PRZELEW
  69. {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"},
  70. {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"},
  71. {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"},
  72. {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"},
  73.  
  74. -- HISTORIA PRZELEWÓW
  75. {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"},
  76.  
  77. {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"},
  78.  
  79. -- PRZELEW BIZNES
  80. {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"},
  81. {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"},
  82. {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"},
  83. {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"},
  84. }
  85.  
  86. local txt_wins={
  87. {text="BANKOMAT / WPŁATOMAT",color={255,255,255,255},page="bankomat_start"},
  88. {text="WPŁATOMAT - WPŁACANIE PIENIĘDZY",color={255,255,255,255},page="wplata"},
  89. {text="BANKOMAT - WYPŁACANIE ŚRODKÓW",color={255,255,255,255},page="wyplata"},
  90. {text="ODDZIAŁ BANKU - SAN ANDREAS",color={255,255,255,255},page="bank_start"},
  91. {text="ZARZĄDZANIE KARTĄ",color={255,255,255,255},page="zarzadzaj_karta"},
  92. {text="PRZELEW BANKOWY",color={255,255,255,255},page="przelew"},
  93. {text="POTWIERDZENIE PRZELEWU",color={255,255,255,255},page="przelew_2"},
  94. {text="PRZELEW BANKOWY",color={255,255,255,255},page="przelewbiznes"},
  95. {text="POTWIERDZENIE PRZELEWU",color={255,255,255,255},page="przelewbiznes_2"},
  96. {text="HISTORIA DZIAŁAŃ",color={255,255,255,255},page="historia_przelewow"},
  97. }
  98.  
  99. local wplataWyplata=guiCreateEdit((sX-390)/2,(sY+20)/2,440,40,"",false)
  100. guiSetAlpha(wplataWyplata,0.55)
  101. guiEditSetMaxLength(wplataWyplata,12)
  102. guiSetFont(wplataWyplata,latoReg11_gui)
  103. --guiSetProperty(wplataWyplata,"ValidationString","^[0-9]*$")
  104. guiSetVisible(wplataWyplata,false)
  105.  
  106. local dbid=guiCreateEdit((sX-90)/2,(sY-100)/2,140,40,"",false)
  107. guiSetAlpha(dbid,0.55)
  108. guiEditSetMaxLength(dbid,10)
  109. guiSetFont(dbid,latoReg11_gui)
  110. --guiSetProperty(dbid,"ValidationString","^[0-9]*$")
  111. guiSetVisible(dbid,false)
  112.  
  113. -- LISTA
  114. local function myMouseOnList(x,y,w,h)
  115. if isCursorShowing() and panelEnabled then
  116. local cX,cY=getCursorPosition()
  117. cX,cY=cX*sX,cY*sY
  118. if(cX>x and cX<x+w) and (cY>y and cY<y+h) then return true end
  119. end
  120. return false
  121. end
  122.  
  123. local function onClientKey(btn)
  124. if btn=="mouse_wheel_down" then
  125. if panelEnabled then
  126. if iloscOpcji>5 then
  127. if myMouseOnList(winX,winY,winW,winH) then
  128. opcjaPodstawowa=opcjaPodstawowa+1
  129. if opcjaPodstawowa>iloscOpcji-iloscWidocznych then opcjaPodstawowa=iloscOpcji-iloscWidocznych end
  130. end
  131. end
  132. end
  133. elseif btn=="mouse_wheel_up" then
  134. if panelEnabled then
  135. if iloscOpcji>5 then
  136. if myMouseOnList(winX,winY,winW,winH) then
  137. opcjaPodstawowa=opcjaPodstawowa-1
  138. if opcjaPodstawowa<0 then opcjaPodstawowa=0 end
  139. end
  140. end
  141. end
  142. end
  143. end
  144.  
  145. local function deleteList()
  146. for i,v in ipairs(btn) do
  147. if v.typ=="lista" then btn[i]=nil iloscOpcji=0 opcjaPodstawowa=0 end
  148. end
  149. end
  150.  
  151. local function addButtonsToWindow()
  152.  
  153. local cX,cY=getCursorPosition()
  154. cX,cY=cX*sX,cY*sY
  155.  
  156. for i,v in ipairs(btn) do
  157. if v.page==page then
  158. if v.typ=="akcja" then
  159. 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
  160. if v.wExtra<10 then v.wExtra=v.wExtra+1 end
  161. if v.color[4]<190 then v.color[4]=v.color[4]+9 end
  162. else
  163. if v.wExtra>0 then v.wExtra=v.wExtra-1 end
  164. if v.color[4]>100 then v.color[4]=v.color[4]-9 end
  165. end
  166. 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
  167. 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
  168. elseif v.typ=="akcja_1" then
  169. 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
  170. if v.wExtra<10 then v.wExtra=v.wExtra+1 end
  171. if v.color[4]<190 then v.color[4]=v.color[4]+9 end
  172. else
  173. if v.wExtra>0 then v.wExtra=v.wExtra-1 end
  174. if v.color[4]>100 then v.color[4]=v.color[4]-9 end
  175. end
  176. 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
  177. 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
  178. 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
  179. elseif v.typ=="lista" then
  180. visible=(v.id-1)-opcjaPodstawowa
  181. if iloscOpcji<=5 and iloscOpcji>0 then
  182. if myMouseOnList(winX,winY+(optionH+5)*(v.id-1),winW,optionH) then
  183. if v.color[4]<190 then v.color[4]=v.color[4]+9 end
  184. else
  185. if v.color[4]>100 then v.color[4]=v.color[4]-9 end
  186. end
  187. dxDrawRectangle(winX+winW,winY,6,winH,tocolor(255,255,255,190)) -- PASEK SCROLLA
  188. dxDrawRectangle(winX,winY+(optionH+5)*visible,winW,optionH,tocolor(v.color[1],v.color[2],v.color[3],v.color[4]))
  189. 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)
  190. 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)
  191. 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)
  192. elseif iloscOpcji>5 then
  193. if myMouseOnList(winX,winY+(optionH+5)*visible,winW,optionH) then
  194. if v.color[4]<190 then v.color[4]=v.color[4]+9 end
  195. else
  196. if v.color[4]>100 then v.color[4]=v.color[4]-9 end
  197. end
  198. dxDrawRectangle(winX+winW,winY+winH/iloscOpcji*opcjaPodstawowa,6,winH/iloscOpcji*iloscWidocznych,tocolor(255,255,255,190)) -- PASEK SCROLLA
  199. if v.id>opcjaPodstawowa and v.id<=opcjaPodstawowa+5 then
  200. dxDrawRectangle(winX,winY+(optionH+5)*visible,winW,optionH,tocolor(v.color[1],v.color[2],v.color[3],v.color[4]))
  201. 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)
  202. 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)
  203. 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)
  204. end
  205. end
  206. end
  207. end
  208. end
  209. end
  210.  
  211. local function panelWindowMain()
  212. dxDrawRectangle((sX-800)/2,(sY-450)/2,800,450,tocolor(0,0,0,120),false)
  213. for p=1,59 do
  214. dxDrawRectangle((sX-800)/2,(sY-450)/2-p+59,p,1,tocolor(255, 255, 0,100),false)
  215. dxDrawRectangle((sX+800)/2,(sY-450)/2-p+59,-p,1,tocolor(255, 255, 0,100),false)
  216. dxDrawRectangle((sX-800)/2,(sY+330)/2+p,p,1,tocolor(255, 255, 0,100),false)
  217. dxDrawRectangle((sX+800)/2-p,(sY+330)/2+p,p,1,tocolor(255, 255, 0,100),false)
  218. end
  219. dxDrawRectangle((sX-682)/2,(sY+450)/2-1,682,1,tocolor(255, 255, 0,100),false)
  220.  
  221. for p=1,60 do
  222. dxDrawRectangle((sX-400)/2,(sY-450)/2-p+60,-p,1,tocolor(255, 255, 0,100),false)
  223. dxDrawRectangle((sX+400)/2,(sY-450)/2-p+60,p,1,tocolor(255, 255, 0,100),false)
  224. end
  225. dxDrawRectangle((sX-400)/2,(sY-450)/2,400,60,tocolor(255, 255, 0,100),false)
  226.  
  227. for i,v in ipairs(txt_wins) do
  228. 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
  229. end
  230. end
  231.  
  232. local function panelGieldaKonfiskata()
  233. -- panel
  234. panelWindowMain()
  235. if page=="wplata" then
  236. 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)
  237. 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)
  238. -- zielone tło
  239. dxDrawRectangle((sX-500)/2,(sY+10)/2,50,50,tocolor(255, 255, 0,100),false)
  240. -- białe tło
  241. dxDrawRectangle((sX-400)/2,(sY+10)/2,450,50,tocolor(255,255,255,100),false)
  242. -- infolabele
  243. 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
  244. -- obrazki
  245. dxDrawImage((sX-490)/2,(sY+20)/2,40,40,"i/1.png",0,0,0,tocolor(255,255,255,200),false)
  246. elseif page=="wyplata" then
  247. 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)
  248. 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)
  249. -- zielone tło
  250. dxDrawRectangle((sX-500)/2,(sY+10)/2,50,50,tocolor(255, 255, 0,100),false)
  251. -- białe tło
  252. dxDrawRectangle((sX-400)/2,(sY+10)/2,450,50,tocolor(255,255,255,100),false)
  253. -- infolabele
  254. 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
  255. -- obrazki
  256. dxDrawImage((sX-490)/2,(sY+20)/2,40,40,"i/2.png",0,0,0,tocolor(255,255,255,200),false)
  257. elseif page=="zarzadzaj_karta" then
  258. dxDrawImage((sX-380)/2,(sY-260)/2,380,220,"i/karta.png",0,0,0,tocolor(255,255,255,160),false)
  259. if not karta then
  260. dxDrawImage((sX-380)/2,(sY-260)/2,380,220,"i/karta_pasek.png",0,0,0,tocolor(255,255,255,255),false)
  261. else
  262. 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)
  263. 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)
  264. end
  265. elseif page=="przelew" then
  266. 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)
  267. 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)
  268. -- zielone tło
  269. dxDrawRectangle((sX-200)/2,(sY-110)/2,50,50,tocolor(255, 255, 0,100),false)
  270. dxDrawRectangle((sX-500)/2,(sY+10)/2,50,50,tocolor(255, 255, 0,100),false)
  271. -- białe tło
  272. dxDrawRectangle((sX-100)/2,(sY-110)/2,150,50,tocolor(255,255,255,100),false)
  273. dxDrawRectangle((sX-400)/2,(sY+10)/2,450,50,tocolor(255,255,255,100),false)
  274. -- infolabele
  275. 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
  276. 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
  277. -- obrazki
  278. dxDrawImage((sX-490)/2,(sY+20)/2,40,40,"i/2.png",0,0,0,tocolor(255,255,255,200),false)
  279. dxDrawImage((sX-190)/2,(sY-100)/2,40,40,"i/6.png",0,0,0,tocolor(255,255,255,200),false)
  280. elseif page=="przelew_2" then
  281. 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)
  282. 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)
  283. 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)
  284. 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)
  285. elseif page=="przelewbiznes" then
  286. 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)
  287. 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)
  288. -- zielone tło
  289. dxDrawRectangle((sX-200)/2,(sY-110)/2,50,50,tocolor(255, 255, 0,100),false)
  290. dxDrawRectangle((sX-500)/2,(sY+10)/2,50,50,tocolor(255, 255, 0,100),false)
  291. -- białe tło
  292. dxDrawRectangle((sX-100)/2,(sY-110)/2,150,50,tocolor(255,255,255,100),false)
  293. dxDrawRectangle((sX-400)/2,(sY+10)/2,450,50,tocolor(255,255,255,100),false)
  294. -- infolabele
  295. 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
  296. 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
  297. -- obrazki
  298. dxDrawImage((sX-490)/2,(sY+20)/2,40,40,"i/2.png",0,0,0,tocolor(255,255,255,200),false)
  299. dxDrawImage((sX-190)/2,(sY-100)/2,40,40,"i/6.png",0,0,0,tocolor(255,255,255,200),false)
  300. elseif page=="przelewbiznes_2" then
  301. 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)
  302. 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)
  303. 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)
  304. 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)
  305. elseif page=="historia_przelewow" then
  306. dxDrawRectangle((sX-750)/2,(sY-296)/2,750,50,tocolor(255, 255, 0,100),false)
  307. dxDrawRectangle((sX-750)/2,(sY+264)/2,750,2,tocolor(255, 255, 0,100),false)
  308. dxDrawRectangle((sX-750)/2,(sY-196)/2,2,230,tocolor(255, 255, 0,100),false)
  309. dxDrawRectangle((sX+746)/2,(sY-196)/2,2,230,tocolor(255, 255, 0,100),false)
  310.  
  311. 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)
  312. 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)
  313. 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)
  314. end
  315. addButtonsToWindow()
  316. end
  317.  
  318. addEvent("panelBanku_c",true)
  319. addEventHandler("panelBanku_c",resourceRoot,function(cmd,d,d2,d3)
  320. if cmd=="showWindow" then
  321. if d then
  322. if not d2 then return end
  323. if panelEnabled then return end
  324. addEventHandler("onClientRender",root,panelGieldaKonfiskata)
  325. addEventHandler("onClientClick",root,onClientClick)
  326. addEventHandler("onClientKey",root,onClientKey)
  327. panelEnabled=true
  328. kasa=d2
  329. okienko=d3
  330. karta=getElementData(localPlayer,"bank:karta")
  331. page=okienko.."_start"
  332. showCursor(true,false)
  333. guiSetInputMode("no_binds")
  334. setElementData(localPlayer,"3dtext_status",false)
  335. elseif not d then
  336. removeEventHandler("onClientRender",root,panelGieldaKonfiskata)
  337. removeEventHandler("onClientClick",root,onClientClick)
  338. removeEventHandler("onClientKey",root,onClientKey)
  339. panelEnabled=false
  340. page="bankomat_start"
  341. okienko=nil
  342. karta=nil
  343. showCursor(false,false)
  344. guiSetInputMode("allow_binds")
  345. setElementData(localPlayer,"3dtext_status",true)
  346. end
  347. elseif cmd=="odswiezPanel" then
  348. if page=="wplata" or page=="wyplata" then kasa=d
  349. elseif page=="zarzadzaj_karta" then
  350. karta=d
  351. antyLag=false
  352. if not karta then btn[15].text="WYRÓB NOWĄ KARTĘ (2,500,000PLN)" else btn[15].text="DEZAKTYWUJ KARTĘ" end
  353. elseif page=="przelew_2" then
  354. page="przelew"
  355. guiSetVisible(wplataWyplata,true)
  356. guiSetVisible(dbid,true)
  357. kasa=d
  358. odbiorca=nil
  359. dbidOdbiorcy=0
  360. kwotaPrzelewu=0
  361. elseif page=="przelewbiznes_2" then
  362. page="przelewbiznes"
  363. guiSetVisible(wplataWyplata,true)
  364. guiSetVisible(dbid,true)
  365. kasa=d
  366. odbiorca=nil
  367. dbidOdbiorcy=0
  368. kwotaPrzelewu=0
  369. end
  370. elseif cmd=="przelewaniePieniedzy_2" then
  371. guiSetText(wplataWyplata,"")
  372. guiSetText(dbid,"")
  373. guiSetVisible(wplataWyplata,false)
  374. guiSetVisible(dbid,false)
  375. odbiorca=d
  376. kwotaPrzelewu=d2
  377. dbidOdbiorcy=d3
  378. page="przelew_2"
  379. elseif cmd=="przelewaniePieniedzy_4" then
  380. guiSetText(wplataWyplata,"")
  381. guiSetText(dbid,"")
  382. guiSetVisible(wplataWyplata,false)
  383. guiSetVisible(dbid,false)
  384. odbiorca=d
  385. kwotaPrzelewu=d2
  386. dbidOdbiorcy=d3
  387. page="przelewbiznes_2"
  388. elseif cmd=="unlock" then
  389. antyLag=false
  390. elseif cmd=="pobierzHistorie" then
  391. for i,v in ipairs(d) do
  392. 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}})
  393. 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}})
  394. 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}})
  395. else
  396. 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}})
  397. 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
  398. end
  399.  
  400. iloscOpcji=iloscOpcji+1
  401. end
  402. end
  403. end)
  404.  
  405. -- PRZYCISKI (CLICK)
  406. function onClientClick(_,state,x,y)
  407. -- zabezpieczenie przed aktywacją przycisków poza panelem
  408. if not panelEnabled then return end
  409.  
  410. -- aktywacja przycisków
  411. if state=="up" then
  412. local bClick=nil
  413. for i,v in ipairs(btn) do
  414. if v.page==page and not antyLag then
  415. if v.typ=="akcja" then
  416. 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
  417. bClick=v
  418. v.color[4]=100
  419. v.wExtra=0
  420. end
  421. elseif v.typ=="akcja_1" then
  422. 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
  423. bClick=v
  424. v.color[4]=100
  425. v.wExtra=0
  426. end
  427. end
  428. end
  429. end
  430. if not bClick then return end
  431.  
  432. if bClick.text=="ZAMKNIJ PANEL" then triggerEvent("panelBanku_c",resourceRoot,"showWindow",false) page=nil end
  433. if page=="bankomat_start" or page=="bank_start" then
  434. if bClick.text=="WPŁAĆ PIENIĄDZE" then
  435. page="wplata"
  436. guiSetVisible(wplataWyplata,true)
  437. elseif bClick.text=="WYPŁAĆ ŚRODKI" then
  438. page="wyplata"
  439. guiSetVisible(wplataWyplata,true)
  440. end
  441. end
  442. if page=="bank_start" then
  443. if bClick.text=="ZARZĄDZAJ\nKARTĄ" then
  444. if not karta then btn[15].text="WYRÓB NOWĄ KARTĘ (2,500,000 PLN)" else btn[15].text="DEZAKTYWUJ KARTĘ" end
  445. page="zarzadzaj_karta"
  446. elseif bClick.text=="WYKONAJ\nPRZELEW" then
  447. page="przelew"
  448. guiSetVisible(wplataWyplata,true)
  449. guiSetVisible(dbid,true)
  450. elseif bClick.text=="PRZELEW\nDO BIZNESU" then
  451. page="przelewbiznes"
  452. guiSetVisible(wplataWyplata,true)
  453. guiSetVisible(dbid,true)
  454. elseif bClick.text=="HISTORIA\nTRANSAKCJI" then
  455. triggerServerEvent("panelBanku",resourceRoot,"pobierzHistorie")
  456. page="historia_przelewow"
  457. end
  458. elseif page=="wplata" then
  459. if bClick.text=="WPŁAĆ PIENIĄDZE" then
  460. if string.len(guiGetText(wplataWyplata))==0 then outputChatBox("Wpisz kwotę, którą chcesz wpłacić na konto bankowe.") return end
  461. if tonumber(guiGetText(wplataWyplata)) then
  462. triggerServerEvent("panelBanku",resourceRoot,"wplacaniePieniedzy",tonumber(guiGetText(wplataWyplata)),okienko)
  463. guiSetText(wplataWyplata,"")
  464. else outputChatBox("Nieprawidłowy format.") end
  465. elseif bClick.text=="POWRÓT DO POPRZEDNIEJ STRONY" then
  466. guiSetVisible(wplataWyplata,false)
  467. guiSetText(wplataWyplata,"")
  468. page=okienko.."_start"
  469. end
  470. elseif page=="wyplata" then
  471. if bClick.text=="WYPŁAĆ ŚRODKI" then
  472. if string.len(guiGetText(wplataWyplata))==0 then outputChatBox("Wpisz kwotę, którą chcesz wypłacić z konta bankowego.") return end
  473. if tonumber(guiGetText(wplataWyplata)) then
  474. if tonumber(guiGetText(wplataWyplata))<(0) then outputChatBox("Nieprawidłowy format.") return end
  475. local kasa = split(guiGetText(wplataWyplata), "")
  476. if kasa[2] then if string.len(kasa[2]) > 2 then outputChatBox("Max 2 znaki po przecinku.") return end end
  477. triggerServerEvent("panelBanku",resourceRoot,"wyplacaniePieniedzy",tonumber(guiGetText(wplataWyplata)),okienko)
  478. guiSetText(wplataWyplata,"")
  479. else outputChatBox("Nieprawidłowy format.") end
  480. elseif bClick.text=="POWRÓT DO POPRZEDNIEJ STRONY" then
  481. guiSetVisible(wplataWyplata,false)
  482. guiSetText(wplataWyplata,"")
  483. page=okienko.."_start"
  484. end
  485. elseif page=="zarzadzaj_karta" then
  486. if bClick.text=="WYRÓB NOWĄ KARTĘ (2,500,000 PLN)" or bClick.text=="DEZAKTYWUJ KARTĘ" then antyLag=true triggerServerEvent("panelBanku",resourceRoot,"wyrabianieKarty",okienko)
  487. elseif bClick.text=="POWRÓT DO POPRZEDNIEJ STRONY" then page=okienko.."_start" end
  488. elseif page=="przelew" then
  489. if bClick.text=="WYKONAJ PRZELEW" then
  490. if string.len(guiGetText(dbid))==0 then outputChatBox("Wpisz SID odbiorcy.") return end
  491. if string.len(guiGetText(wplataWyplata))==0 then outputChatBox("Wpisz kwotę przelewu.") return end
  492. if tonumber(guiGetText(wplataWyplata)) then
  493. if tonumber(guiGetText(wplataWyplata))<100 then outputChatBox("Przelew bankowy można wykonać na kwotę od 100PLN.") return end
  494. triggerServerEvent("panelBanku",resourceRoot,"przelewaniePieniedzy",tonumber(guiGetText(dbid)),tonumber(guiGetText(wplataWyplata)))
  495. else outputChatBox("Nieprawidłowy format.") end
  496. elseif bClick.text=="POWRÓT DO POPRZEDNIEJ STRONY" then
  497. guiSetVisible(wplataWyplata,false)
  498. guiSetVisible(dbid,false)
  499. guiSetText(wplataWyplata,"")
  500. guiSetText(dbid,"")
  501. page=okienko.."_start"
  502. end
  503. elseif page=="przelew_2" then
  504. if bClick.text=="POTWIERDŹ PRZELEW" then triggerServerEvent("panelBanku",resourceRoot,"przelewaniePieniedzy_2",dbidOdbiorcy,odbiorca,kwotaPrzelewu)
  505. elseif bClick.text=="POWRÓT DO POPRZEDNIEJ STRONY" then
  506. odbiorca=nil
  507. dbidOdbiorcy=0
  508. kwotaPrzelewu=0
  509. guiSetVisible(wplataWyplata,true)
  510. guiSetVisible(dbid,true)
  511. page="przelew"
  512. end
  513. elseif page=="przelewbiznes" then
  514. if bClick.text=="WYKONAJ PRZELEW" then
  515. if string.len(guiGetText(dbid))==0 then outputChatBox("Wpisz ID biznesu.") return end
  516. if string.len(guiGetText(wplataWyplata))==0 then outputChatBox("Wpisz kwotę przelewu.") return end
  517. if tonumber(guiGetText(wplataWyplata)) then
  518. if tonumber(guiGetText(wplataWyplata))<100 then outputChatBox("Przelew bankowy można wykonać na kwotę od 100PLN.") return end
  519.  
  520. triggerServerEvent("panelBanku",resourceRoot,"przelewaniePieniedzy_3",tonumber(guiGetText(dbid)),tonumber(guiGetText(wplataWyplata)))
  521. else outputChatBox("Nieprawidłowy format.") end
  522. elseif bClick.text=="POWRÓT DO POPRZEDNIEJ STRONY" then
  523. guiSetVisible(wplataWyplata,false)
  524. guiSetVisible(dbid,false)
  525. guiSetText(wplataWyplata,"")
  526. guiSetText(dbid,"")
  527. page=okienko.."_start"
  528. end
  529. elseif page=="przelewbiznes_2" then
  530. if bClick.text=="POTWIERDŹ PRZELEW" then triggerServerEvent("panelBanku",resourceRoot,"przelewaniePieniedzy_4",dbidOdbiorcy,odbiorca,kwotaPrzelewu)
  531. elseif bClick.text=="POWRÓT DO POPRZEDNIEJ STRONY" then
  532. odbiorca=nil
  533. dbidOdbiorcy=0
  534. kwotaPrzelewu=0
  535. guiSetVisible(wplataWyplata,true)
  536. guiSetVisible(dbid,true)
  537. page="przelewbiznes"
  538. end
  539. elseif page=="historia_przelewow" then
  540. if bClick.text=="POWRÓT DO POPRZEDNIEJ STRONY" then
  541. page=okienko.."_start"
  542. deleteList()
  543. end
  544. end
  545. end
  546. end
  547.  
  548. -- Zabezpieczenie przez zbugowaniem gracza ze statusem "no_binds"
  549. addEventHandler("onClientResourceStop",resourceRoot,function()
  550. if panelEnabled then
  551. panelEnabled=false
  552. guiSetInputMode("allow_binds")
  553. setElementData(localPlayer,"3dtext_status",true)
  554. end
  555. end)[/lua]
  556.  
  557. oraz bank7895542_new
  558.  
  559.  
  560.  
  561. [lua]local banks={
  562. {pozATM={1465.83, -1749.91, 15.45,180},typ="bankomat"},
  563. {pozATM={-2665.41, -12.46, 6.13,-90},typ="bankomat"},
  564. {pozATM={-2058.65, -101.89, 35.17,-535},typ="bankomat"},
  565. {pozATM={-1894.82, -510.55, 24.98,0},typ="bankomat"},
  566. {pozATM={-2032.98, 164.66, 28.84,90},typ="bankomat"},
  567. {pozATM={-1974.29, 309.36, 35.17,0},typ="bankomat"},
  568. {pozATM={-1798.35, 1200.63, 25.12,0},typ="bankomat"},
  569. {pozATM={-1653.16, 1206.55, 7.25,-535},typ="bankomat"},
  570. {pozATM={-2715.56, 223.22, 4.33,90},typ="bankomat"},
  571. {pozATM={-1851.98, 1421.64, 7.18,-90},typ="bankomat"},
  572. {pozATM={-1711.88, -64.47, 3.55,-50},typ="bankomat"},
  573. {pozATM={-2930.80, 457.34, 4.91,88},typ="bankomat"},
  574. {pozATM={-2297.92, -172.53, 35.32,127},typ="bankomat"},
  575. {pozATM={-1561.48, 132.19, 3.55,135},typ="bankomat"},
  576. {pozATM={-1693.15, 415.17, 7.18,45},typ="bankomat"},
  577. {pozATM={-2374.56, 905.03, 45.45,270},typ="bankomat"},
  578. {pozATM={-1982.63, 620.47, 35.17,360},typ="bankomat"},
  579. {pozATM={-1745.74, 771.45, 24.89,360},typ="bankomat"},
  580. {pozATM={-924.91, -519.22, 25.95,470},typ="bankomat"},
  581. {pozATM={-1061.09, -1192.22, 129.22,90},typ="bankomat"},
  582. {pozATM={-2670.92, 636.53, 14.45,90},typ="bankomat"},
  583. {pozATM={-1625.36, 717.60, 14.61,90},typ="bankomat"},
  584. {pozATM={-1018.41, -698.41, 32.01,90},typ="bankomat"},
  585. {pozATM={-2203.24, -2332.91, 30.63,230},typ="bankomat"},
  586. {pozATM={-2354.78, -1632.96, 486.01,90},typ="bankomat"},
  587. {pozATM={-2338.77, -1636.21, 484.75,90},typ="bankomat"},
  588. {pozATM={2798.90, 973.50, 10.75,0},typ="bankomat"},
  589. {pozATM={2117.71, 2362.37, 10.82,90},typ="bankomat"},
  590. {pozATM={1624.54, -1135.28, 23.91,90},typ="bankomat"},
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598. {poz={-3418.92, 402.67, 17.91},typ="bank",int=0,dim=69},
  599.  
  600.  
  601. }
  602.  
  603. for i,v in ipairs(banks) do
  604. if v.typ=="bankomat" then
  605. v.atm=createObject(2942,v.pozATM[1],v.pozATM[2],v.pozATM[3]-0.4,0,0,v.pozATM[4])
  606. setElementDimension(v.atm,v.dim or 0)
  607. setElementInterior(v.atm,v.int or 0)
  608.  
  609. local x,y,z=getElementPosition(v.atm)
  610. local _,_,rz=getElementRotation(v.atm)
  611. local rrz=math.rad(rz)
  612. local px=x-(0.8*math.sin(-rrz))
  613. local py=y-(0.8*math.cos(-rrz))
  614.  
  615. v.marker=createMarker(px,py,v.pozATM[3]-1,'cylinder',1.1, 255, 255, 0)
  616. setElementDimension(v.marker,v.dim or 0)
  617. setElementInterior(v.marker,v.int or 0)
  618. local t=createElement("text")
  619. setElementPosition(t,v.pozATM[1],v.pozATM[2],v.pozATM[3]-0.05)
  620. setElementData(t,"name","Bankomat 24/7")
  621. setElementDimension(t,v.dim or 0)
  622. setElementInterior(t,v.int or 0)
  623. else
  624. v.marker=createMarker(v.poz[1],v.poz[2],v.poz[3]-1,'cylinder',1.1,255, 255, 0)
  625. setElementDimension(v.marker,v.dim or 0)
  626. setElementInterior(v.marker,v.int or 0)
  627. local t=createElement("text")
  628. setElementPosition(t,v.poz[1],v.poz[2],v.poz[3]-0.05)
  629. setElementData(t,"name","MazeBank\nChmura RPG")
  630. setElementDimension(t,v.dim or 0)
  631. setElementInterior(t,v.int or 0)
  632. end
  633. end
  634.  
  635. function ifMandaty(plr)
  636. if not plr then return end
  637. if getElementData(plr,"player:mandate")>=500000 then return true
  638. else return false end
  639. end
  640.  
  641. addEventHandler("onMarkerHit",resourceRoot,function(plr,dim)
  642. if not dim then return end
  643. if getElementType(plr)=="player" then
  644. if isPedInVehicle(plr) then return end
  645. local z_m=nil
  646. for i,v in ipairs(banks) do
  647. if v.marker==source then z_m=v end
  648. end
  649. if not z_m then return end
  650.  
  651. for i,v in ipairs(banks) do
  652. if v.marker==source then
  653. if v.typ=="bankomat" then
  654. if not getElementData(plr,"bank:karta") then
  655. outputChatBox("Nie posiadasz karty bankomatowo-płatniczej!",plr)
  656. outputChatBox("Udaj się do najbliższej placówki banku, aby ją nabyć.",plr)
  657. return
  658. end
  659. end
  660. local zap=exports["DB2"]:pobierzWyniki("SELECT bank_money FROM pystories_users WHERE id=?",getElementData(plr,"player:sid"))
  661. if not zap then return end
  662. triggerClientEvent(plr,"panelBanku_c",resourceRoot,"showWindow",true,tostring(tonumber(zap.bank_money)),v.typ)
  663. end
  664. end
  665. end
  666. end)
  667.  
  668. addEvent("panelBanku",true)
  669. addEventHandler("panelBanku",resourceRoot,function(cmd,d,d2,d3,d4)
  670. if cmd=="wplacaniePieniedzy" then
  671. if(d>0) then
  672. if (d)<=getPlayerMoney(client) then
  673. local kwota=tostring(d)
  674. kwota=(kwota)
  675. kwota=kwota
  676. takePlayerMoney(client,kwota)
  677. exports["pystories-db"]:dbSet("UPDATE pystories_users SET bank_money=bank_money+? WHERE id=? LIMIT 1",kwota,getElementData(client,"player:sid"))
  678. 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)
  679. local zap=exports["DB2"]:pobierzWyniki("SELECT bank_money FROM pystories_users WHERE id=? LIMIT 1",getElementData(client,"player:sid"))
  680. if not zap then return end
  681. triggerClientEvent(client,"panelBanku_c",resourceRoot,"odswiezPanel",tonumber(zap.bank_money))
  682. if d2=="bank" then --exports["es-logi"]:outputUcho("BANK WPLATA: "..getPlayerName(client).." kwota: "..string.format("%.2f",kwota/100).." PLN")
  683. else --exports["es-logi"]:outputUcho("BANKOMAT WPLATA: "..getPlayerName(client).." kwota: "..string.format("%.2f",kwota/100).." PLN") end
  684. end
  685. outputChatBox("Wpłata została wykonana pomyślnie.",client)
  686. else outputChatBox("Nie posiadasz tyle gotówki.",client) end
  687. else outputChatBox("Kwota musi być większa niż 0 PLN.",client) end
  688. elseif cmd=="wyplacaniePieniedzy" then
  689. if(d>0) then
  690. local zap=exports["DB2"]:pobierzWyniki("SELECT bank_money FROM pystories_users WHERE id=? LIMIT 1",getElementData(client,"player:sid"))
  691. if not zap then return end
  692. local kwota=d
  693. kwota=(kwota)
  694. if(zap.bank_money>=kwota) then
  695. if (getPlayerMoney(client)+kwota>99999999) then outputChatBox("Możesz mieć przy sobie maksymalnie 99,999,999 PLN.",client)
  696. else
  697. givePlayerMoney(client,kwota)
  698. exports["pystories-db"]:dbSet("UPDATE pystories_users SET bank_money=bank_money-? WHERE id=? LIMIT 1",kwota,getElementData(client,"player:sid"))
  699. 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)
  700. triggerClientEvent(client,"panelBanku_c",resourceRoot,"odswiezPanel",tonumber((zap.bank_money-kwota)))
  701. outputChatBox("Wypłata została wykonana pomyślnie.",client)
  702. if d2=="bank" then --exports["es-logi"]:outputUcho("BANK WYPLATA: "..getPlayerName(client).." kwota: "..string.format("%.2f",kwota/100).." PLN")
  703. else --exports["es-logi"]:outputUcho("BANKOMAT WYPLATA: "..getPlayerName(client).." kwota: "..string.format("%.2f",kwota/100).." PLN") end
  704. end
  705. end
  706. else outputChatBox("Nie posiadasz takiej ilości środków na koncie.",client) end
  707. else outputChatBox("Kwota musi być większa niż 0PLN.",client) end
  708. zap=nil
  709. elseif cmd=="wyrabianieKarty" then
  710. if not getElementData(client,"bank:karta") then
  711. if getPlayerMoney(client)<(2500000) then
  712. outputChatBox("Nie posiadasz tyle gotówki - 2,500,000PLN.",client)
  713. triggerClientEvent(client,"panelBanku_c",resourceRoot,"unlock")
  714. return
  715. end
  716. takePlayerMoney(client,(2500000))
  717. setElementData(client,"bank:karta",true)
  718. exports["pystories-db"]:dbSet("UPDATE pystories_users SET karta_bank='tak' WHERE id=?",getElementData(client,"player:sid"))
  719. outputChatBox("Wyrobiono kartę bankomatowo-płatniczą.",client)
  720. outputChatBox("Od teraz możesz wpłacać i wypłacać gotówkę w bankomatach.",client)
  721. --exports["es-logi"]:outputUcho("BANK KARTA: "..getPlayerName(client).." aktywuje nową kartę bankomatowo-płatniczą za 150PLN.")
  722. zap=nil
  723. else
  724. removeElementData(client,"bank:karta")
  725. exports["pystories-db"]:dbSet("UPDATE pystories_users SET karta_bank=NULL WHERE id=?",getElementData(client,"player:sid"))
  726. outputChatBox("Dezaktywowano kartę bankomatowo-płatniczą.",client)
  727. outputChatBox("Nie możesz już wpłacać i wypłacać gotówki poprzez bankomaty.",client)
  728. --exports["es-logi"]:outputUcho("BANK KARTA: "..getPlayerName(client).." dezaktywuje swoją kartę bankomatowo-płatniczą.")
  729. zap=nil
  730. end
  731. triggerClientEvent(client,"panelBanku_c",resourceRoot,"odswiezPanel",getElementData(client,"bank:karta"))
  732. elseif cmd=="przelewaniePieniedzy" then
  733. local odbiorca=exports["DB2"]:pobierzWyniki("SELECT login FROM pystories_users WHERE id=? LIMIT 1",d)
  734. if odbiorca then
  735. local kwota=d2
  736. kwota=(kwota)
  737. triggerClientEvent(client,"panelBanku_c",resourceRoot,"przelewaniePieniedzy_2",odbiorca.login,kwota,d)
  738. else outputChatBox("Nie znaleziono gracza w bazie danych o takim ID.",client) end
  739. elseif cmd=="przelewaniePieniedzy_2" then
  740. local kwota=d3
  741. local zap=exports["DB2"]:pobierzWyniki("SELECT bank_money FROM pystories_users WHERE id=?",getElementData(client,"player:sid"))
  742. if zap.bank_money>=kwota then
  743. if not ifMandaty(client) then
  744. exports["pystories-db"]:dbSet("UPDATE pystories_users SET bank_money=bank_money-? WHERE id=? LIMIT 1",kwota,getElementData(client,"player:sid"))
  745. exports["pystories-db"]:dbSet("UPDATE pystories_users SET bank_money=bank_money+? WHERE id=? LIMIT 1",kwota,d)
  746. --exports["es-logi"]:outputUcho("BANK PRZELEW: "..getPlayerName(client).." do DBIDu: "..d.." kwota: "..string.format("%.2f",kwota/100).." PLN")
  747. 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
  748. outputChatBox("Przelew wykonany pomyślnie.",client)
  749. else outputChatBox("Bank wstrzymał twój przelew, ponieważ masz nieopłacone mandaty.",client) end
  750. else outputChatBox("Brak wystarczającej ilości środków na koncie.",client) end
  751. local zap=exports["DB2"]:pobierzWyniki("SELECT bank_money FROM pystories_users WHERE id=?",getElementData(client,"player:sid"))
  752. triggerClientEvent(client,"panelBanku_c",resourceRoot,"odswiezPanel",zap.bank_money)
  753. elseif cmd=="przelewaniePieniedzy_3" then
  754. local odbiorca=exports["DB2"]:pobierzWyniki("SELECT nazwa FROM es_biznesy_stacje_paliw WHERE id=? LIMIT 1",d)
  755. if odbiorca then
  756. local kwota=d2
  757. kwota=(kwota)
  758. triggerClientEvent(client,"panelBanku_c",resourceRoot,"przelewaniePieniedzy_4",odbiorca.nazwa,kwota,d)
  759. else outputChatBox("Nie znaleziono biznesu w bazie danych o takim ID.",client) end
  760. elseif cmd=="przelewaniePieniedzy_4" then
  761. local kwota=d3
  762. local zap=exports["DB2"]:pobierzWyniki("SELECT bank_money FROM pystories_users WHERE id=?",getElementData(client,"player:sid"))
  763. if zap.kasa_bank>=kwota then
  764. if not ifMandaty(client) then
  765. exports["pystories-db"]:dbSet("UPDATE pystories_users SET bank_money=bank_money-? WHERE id=? LIMIT 1",kwota,getElementData(client,"player:sid"))
  766. exports["pystories-db"]:dbSet("UPDATE es_biznesy_stacje_paliw SET kasa=kasa+? WHERE id=? LIMIT 1",kwota,d)
  767. exports["pystories-db"]:dbSet("INSERT INTO es_biznesy_stacje_paliw_historia SET bid=?,typ=?,data=NOW(),operacja=?",d,"zarobek",kwota,getPlayerName(client))
  768. --exports["es-logi"]:outputUcho("BANK PRZELEW BIZNES: "..getPlayerName(client).." do biznesu: "..d2.."[ID:"..d.."] kwota: "..string.format("%.2f",kwota/100).." PLN")
  769. 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
  770. exports["es-komunikaty"]:komunikat("Przelew wykonany pomyślnie.",client)
  771. else exports["es-komunikaty"]:komunikat("Bank wstrzymał twój przelew, ponieważ masz nieopłacone mandaty.",client) end
  772. else exports["es-komunikaty"]:komunikat("Brak wystarczającej ilości środków na koncie.",client) end
  773. local zap=exports["pystories-db"]:dbSet("SELECT bank_money FROM pystories_users WHERE id=?",getElementData(client,"player:sid"))
  774. triggerClientEvent(client,"panelBanku_c",resourceRoot,"odswiezPanel",zap.kasa_ban)
  775. elseif cmd=="pobierzHistorie" then
  776. 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"))
  777. if not zap then return end
  778. triggerClientEvent(client,"panelBanku_c",resourceRoot,"pobierzHistorie",zap)
  779. zap=nil
  780. end
  781. end)[/lua]
  782.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement