Guest User

Untitled

a guest
Sep 12th, 2021
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.76 KB | None | 0 0
  1. local bankomaty={
  2. --x,y,z, rx, ry, rz, INT, DIM,
  3.  
  4. --[[BANKOMATY LOS SANTOS
  5. {2194.30, -1971.70, 13.78-0.35, -0.00, 0.00, 177.89}, -- Praca Smieciarki.
  6. {2110.01, -2100.33, 13.55-0.35, -0.00, 0.00, 359.49}, -- Salon obok Śmieciarek.
  7. {872.86, -1203.87, 16.98-0.35, -0.00, 0.00, 0.30}, -- Salon w Vinewood obok LSPD na PRL.
  8. {2133.30, -1151.32, 24.08-0.35, -0.00, 0.00, 179.41}, -- Salon Motorniczy obok Gangu Blood na PRL. (( Jak jeszcze istnieje. ))
  9. {661.36, -576.13, 16.34-0.35, -0.00, 0.00, 269.16}, -- Stacja Benzynowa Dillimore | Red County.
  10. --BANKOMATY LOS SANTOS--]]
  11.  
  12. --BANKOMATY SAN FIERRO
  13. {-1914.99, 872.88, 35.41-0.35, -0.00, 0.00, 270.16}, -- Spawn.
  14. {-1915.00, 893.88, 35.41-0.35, -0.00, 0.00, 268.96}, -- Spawn.
  15. {-1859.65, -145.76, 11.91-0.35, -0.00, 0.00, 180.49}, -- Praca Sweepery.
  16. {-2032.97, 162.65, 29.04-0.35, -0.00, 0.00, 90.50}, -- Mechanik Doherty.
  17. {-1964.86, 291.72, 35.47-0.35, -0.00, 0.00, 89.13}, -- Salon Doherty.
  18. {-1712.48, 399.23, 7.42-0.35, -0.00, 0.00, 223.78}, -- Praca Cysterny.
  19. {-1648.90, 1202.50, 7.25-0.35, -0.00, 0.00, 180.47}, -- Salon Downtown.
  20. {-1603.62, 710.27, 13.87-0.35, -0.00, 0.00, 178.86}, -- Komenda Główna Policji.
  21. {-1971.48, 620.47, 35.17-0.35, -0.00, 0.00, 0.40}, -- Przechowalnia Pojazdów.
  22. {-2102.42, 0.52, 35.32-0.35, -0.00, 0.00, 179.26}, -- Państwowa Straż Pożarna.
  23. {-2271.49, -132.45, 35.32-0.35, -0.00, 0.00, 359.55}, -- Tuner Garcia.
  24. {-2420.15, 983.44, 45.30-0.35, -0.00, 0.00, 90.56}, -- Stacja Juniper Hollow.
  25. {-1874.00, -219.98, 18.38-0.35, -0.00, 0.00, 88.42}, -- Parking Policyjny Doherty.
  26. {-2637.05, 632.15, 14.45-0.35, -0.00, 0.00, 269.96}, -- Pogotowie Ratunkowe
  27. --BANKOMATY SAN FIERRO
  28.  
  29. --BANKOMATY FORT CARSON
  30. {-134.66, 1087.23, 19.74-0.35, -0.00, 0.00, 269.76},
  31. {-205.19, 1135.14, 19.74-0.35, -0.00, 0.00, 89.84},
  32. {180.66, 655.19, 3.85-0.35, -0.00, 0.00, 12.65},
  33. {302.23, 1139.31, 8.59-0.35, -0.00, 0.00, 89.60},
  34. --{},
  35. --{},
  36. --{},
  37. --{},
  38. --{},
  39. --{},
  40. --{},
  41. --{},
  42. --{},
  43. --BANKOMATY FORT CARSON
  44.  
  45. }
  46.  
  47. for i,v in ipairs(bankomaty) do
  48.  
  49. v.obiekt=createObject(2942,v[1],v[2],v[3],v[4],v[5],v[6])
  50. setElementInterior(v.obiekt,v[7] or 0)
  51. setElementDimension(v.obiekt,v[8] or 0)
  52. setElementFrozen(v.obiekt,true)
  53. setObjectBreakable ( v.obiekt, false )
  54.  
  55. -- v.mapicon=createBlip(v[1],v[2],v[3], 52, 2, 255,255,255,0, -1000, 300)
  56. v.mapicon=createBlip(v[1],v[2],v[3], 52, 1, 5,255,5,255, -1000, 275)
  57. --local x,y,z = getElementPosition(v.obiekt)
  58. --exports.customblips:createCustomBlip( x, y, 20, 20, "52.png" )
  59. setElementInterior(v.obiekt,v[7] or 0)
  60. setElementDimension(v.obiekt,v[8] or 0)
  61.  
  62. v.cs=createColSphere(v[1],v[2],v[3]+1, 1)
  63. setElementInterior(v.cs,v[7] or 0)
  64. setElementDimension(v.cs,v[8] or 0)
  65. v.text=createElement('text')
  66. setElementData(v.text,"name","Bankomat")
  67. setElementPosition(v.text,v[1],v[2],v[3])
  68. end
  69.  
  70.  
  71. local bw={}
  72. bw.win = guiCreateWindow(0.7236,0.3398,0.2314,0.5,"Bankomat",true)
  73. guiWindowSetMovable(bw.win,false)
  74. guiWindowSetSizable(bw.win,false)
  75. bw.lbl1 = guiCreateLabel(0.0633,0.0997,0.903,0.1571,"Stan konta:\n0PLN",true,bw.win)
  76. local font0_money = guiCreateFont("czcionki/MyRiadPro-PYStories.ttf", 10)
  77. guiSetFont(bw.lbl1, font0_money)
  78. guiLabelSetVerticalAlign(bw.lbl1,"center")
  79. guiLabelSetHorizontalAlign(bw.lbl1,"center",false)
  80. local font1_money = guiCreateFont("czcionki/MyRiadPro-PYStories.ttf", 10)
  81.  
  82. bw.lbl2 = guiCreateLabel(0.0759,0.2734,0.8861,0.0695,"Wpłata ───────────────────────",true,bw.win)
  83.  
  84.  
  85. bw.edt1 = guiCreateEdit(0.0675,0.3385,0.8608,0.0859,"0",true,bw.win)
  86. bw.btn_wplac = guiCreateButton(0.0717,0.4427,0.8608,0.0911,"Wpłać",true,bw.win)
  87.  
  88. bw.lbl3 = guiCreateLabel(0.0759,0.5626,0.8861,0.0695,"Wypłata ".."───────────────────────",true,bw.win)
  89. bw.edt2 = guiCreateEdit(0.0675,0.6276,0.8608,0.0859,"0",true,bw.win)
  90. bw.btn_wyplac = guiCreateButton(0.0717,0.7344,0.8608,0.0911,"Wypłać",true,bw.win)
  91.  
  92. bw.btn_zamknij = guiCreateButton(0.0717,0.888,0.8608,0.0859,"Zamknij",true,bw.win)
  93. guiSetFont(bw.win, font1_money)
  94. guiSetFont(bw.lbl2, font1_money)
  95. guiSetFont(bw.edt1, font1_money)
  96. guiSetFont(bw.btn_wplac, font1_money)
  97. guiSetFont(bw.lbl3, font1_money)
  98. guiSetFont(bw.edt2, font1_money)
  99. guiSetFont(bw.btn_wyplac, font1_money)
  100. guiSetFont(bw.btn_zamknij, font1_money)
  101.  
  102.  
  103. guiSetVisible(bw.win, false)
  104.  
  105.  
  106.  
  107. addEventHandler("onClientColShapeHit", resourceRoot, function(el,md)
  108. if not md or el~=localPlayer then return end
  109. -- outputChatBox("Bankomat pokazuje napis: AWARIA.")
  110. -- if getPlayerName(localPlayer)=="Carolynn_Trench" or getPlayerName(localPlayer)=="Bob_Euler" then
  111.  
  112.  
  113. guiSetVisible(bw.win, true)
  114. guiSetEnabled(bw.btn_wyplac, false)
  115. guiSetEnabled(bw.btn_wplac, false)
  116. guiSetText(bw.lbl1,"Trwa otwieranie konta bankowego...")
  117. triggerServerEvent("onPlayerRequestATMInfo", resourceRoot)
  118. --showCursor(true,true)
  119. guiSetInputMode("no_binds_when_editing")
  120. guiSetText(bw.win, string.format("Bankomat (UID:%d)",getElementData(el,"player:uid")))
  121. guiSetText(bw.lbl2, "Wpłata ───────────────────────")
  122. guiSetText(bw.lbl3, "Wypłata ───────────────────────")
  123. guiSetVisible(bw.btn_wyplac, true)
  124. guiSetPosition(bw.btn_wplac, 0.0717,0.4427, true)
  125. -- end
  126. end)
  127.  
  128. local function closeATMWin()
  129. if guiGetVisible(bw.win) then
  130. guiSetVisible(bw.win, false)
  131. --showCursor(false)
  132. end
  133. end
  134.  
  135. addEventHandler("onClientGUIClick", bw.btn_zamknij, closeATMWin, false)
  136. addEventHandler("onClientColShapeLeave", resourceRoot, function(el,md)
  137. if el~=localPlayer then return end
  138. closeATMWin()
  139. end)
  140.  
  141. -- triggerClientEvent(client,"doFillATMInfo", resourceRoot, true, sr.bank_money)
  142. addEvent("doFillATMInfo", true)
  143. addEventHandler("doFillATMInfo", resourceRoot, function(success, balance)
  144. if not success then
  145. guiSetText(bw.lbl1,"Musisz być zarejestrowany.") --Musisz być zarejestrowanym graczem aby skorzystać z bankomatu.
  146. return
  147. end
  148. guiSetText(bw.lbl1,"Stan Twojego konta:".."\n".. balance.." PLN")
  149. setElementData(bw.win, "balance", tonumber(balance))
  150. guiSetText(bw.edt2,100 > balance and balance or 100)
  151. if balance>0 then
  152. guiSetEnabled(bw.btn_wyplac, true)
  153. end
  154.  
  155. guiSetText(bw.edt1,balance)
  156. guiSetEnabled(bw.btn_wplac, true)
  157. end)
  158.  
  159. addEventHandler("onClientPlayerSpawn", localPlayer, closeATMWin)
  160.  
  161.  
  162. addEventHandler("onClientGUIClick", bw.btn_wplac, function()
  163. local kwotae=tonumber(guiGetText(bw.edt1))
  164. if not kwotae then return end
  165. local kwota=math.floor(kwotae)
  166. if not kwota or kwota<1 then
  167. -- triggerEvent("onAnnouncement3", root, "Nieprawidłowa kwota wpłaty.", 4)
  168. outputChatBox("* Nieprawidłowa kwota wpłaty pieniędzy do bankomatu !", 255,0,0)
  169. return
  170. end
  171.  
  172. if guiGetVisible(bw.btn_wyplac) then --normalna wplata
  173.  
  174. if kwota>getPlayerMoney() then
  175. outputChatBox("* Nie posiadasz tyle pieniędzy w bankomacie !", 255,0,0)
  176. return
  177. end
  178.  
  179. closeATMWin()
  180. triggerServerEvent("doATMOperation", resourceRoot, kwota)
  181. end
  182.  
  183. end, false)
  184.  
  185. addEventHandler("onClientGUIClick", bw.btn_wyplac, function()
  186. if not tonumber(guiGetText(bw.edt2)) then return end
  187. local kwotae=tonumber(guiGetText(bw.edt2))
  188. if not kwotae then return end
  189. local kwota=math.floor(kwotae)
  190. if not kwota or kwota<1 then
  191. -- triggerEvent("onAnnouncement3", root, "Nieprawidłowa kwota wypłaty.", 4)
  192. outputChatBox("* Nieprawidłowa kwota wpłaty pieniędzy do bankomatu !", 255,0,0)
  193. return
  194. end
  195. if getPlayerMoney()+kwota>99999999 then
  196. -- triggerEvent("onAnnouncement3", root, "Nie możesz mieć tyle gotówki przy sobie.", 4)
  197. outputChatBox("* Maksymalna ilość gotówki którą możesz posiadać przy Sobie to 999999.99PLN", 255,0,0)
  198. return
  199. end
  200. closeATMWin()
  201. triggerServerEvent("doATMOperation", resourceRoot, -kwota)
  202.  
  203. end, false)
Advertisement
Add Comment
Please, Sign In to add comment