Guest User

Za Deitya

a guest
Dec 14th, 2019
101
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local tresortuer = createObject(2634, 2144.1765136719, 1626.9592285156, 994.27239990234, 0, 0, 180)
  2. local dim = 5
  3. setElementInterior(tresortuer, 1)
  4. setElementDimension(tresortuer, dim)
  5.  
  6. local doing = false
  7.  
  8. local barrels = {
  9. createObject(1222,2153.77124023,1623.12243652,994.38317871,0.00000000,0.00000000,0.00000000), --object(barrel3), (14),
  10. createObject(1222,2155.04418945,1618.16259766,995.15692139,0.00000000,0.00000000,0.00000000), --object(barrel3), (15),
  11. createObject(1222,2154.41943359,1617.46240234,995.15692139,0.00000000,0.00000000,0.00000000), --object(barrel3), (16),
  12. createObject(1222,2153.79736328,1618.64953613,993.16424561,0.00000000,0.00000000,0.00000000), --object(barrel3), (17),
  13. createObject(1222,2151.76367188,1613.64257812,993.16424561,0.00000000,0.00000000,0.00000000), --object(barrel3), (18),
  14. createObject(1222,2148.25390625,1608.07019043,995.40008545,0.00000000,0.00000000,0.00000000), --object(barrel3), (19),
  15. createObject(1222,2147.99389648,1609.18823242,995.40008545,0.00000000,0.00000000,0.00000000), --object(barrel3), (20),
  16. createObject(1222,2146.31274414,1609.05358887,993.16424561,0.00000000,0.00000000,0.00000000), --object(barrel3), (21),
  17. createObject(1222,2147.87939453,1610.77575684,993.16424561,0.00000000,0.00000000,0.00000000), --object(barrel3), (22),
  18. createObject(1222,2141.06420898,1625.57897949,995.29693604,0.00000000,0.00000000,0.00000000), --object(barrel3), (1),
  19. createObject(1222,2142.12011719,1624.64013672,995.29693604,0.00000000,0.00000000,0.00000000), --object(barrel3), (2),
  20. createObject(1222,2147.46215820,1624.57324219,995.29693604,0.00000000,0.00000000,0.00000000), --object(barrel3), (3),
  21. createObject(1222,2148.91308594,1623.70141602,993.16424561,0.00000000,0.00000000,0.00000000), --object(barrel3), (4),
  22. createObject(1222,2147.71752930,1623.47448730,993.16424561,0.00000000,0.00000000,0.00000000), --object(barrel3), (5),
  23. createObject(1222,2132.70410156,1613.04968262,995.29693604,0.00000000,0.00000000,0.00000000), --object(barrel3), (6),
  24. createObject(1222,2132.11596680,1614.04504395,995.29693604,0.00000000,0.00000000,0.00000000), --object(barrel3), (7),
  25. createObject(1222,2134.17236328,1614.76904297,993.16424561,0.00000000,0.00000000,0.00000000), --object(barrel3), (8),
  26. createObject(1222,2136.33496094,1608.22631836,993.16424561,0.00000000,0.00000000,0.00000000), --object(barrel3), (9),
  27. createObject(1222,2136.74145508,1609.32873535,993.16424561,0.00000000,0.00000000,0.00000000), --object(barrel3), (10),
  28. createObject(1222,2137.03515625,1609.25463867,994.41314697,0.00000000,0.00000000,0.00000000), --object(barrel3), (11),
  29. createObject(1222,2131.03247070,1623.24780273,993.16424561,0.00000000,0.00000000,0.00000000), --object(barrel3), (12),
  30. createObject(1222,2153.99218750,1623.33764648,993.16424561,0.00000000,0.00000000,0.00000000), --object(barrel3), (13),
  31. }
  32.  
  33. for index, object in pairs(barrels) do
  34. setElementInterior(object, 1)
  35. setElementDimension(object, dim)
  36. end
  37.  
  38. local doingbankrob = {}
  39. local erbeutet = {}
  40.  
  41. --ped--
  42.  
  43. local ped = {}
  44.  
  45. local function refreshPeds()
  46. for index, p in pairs(ped) do
  47. if(isElement(p)) then
  48. destroyElement(p)
  49. end
  50. end
  51. ped[1] = createPed(164, 351.76852416992, 160.62651062012, 1025.7890625, 271.64801025391) -- Obebedjenje 1
  52. ped[2] = createPed(163, 351.79598999023, 163.98452758789, 1025.7890625, 273.21472167969) -- Obebedjenje 2
  53. ped[3] = createPed(164, 2148.1696777344, 1596.4381103516, 1003.9676513672, 357.48797607422) -- Obebedjenje 3
  54. ped[4] = createPed(163, 2149.3093261719, 1603.3443603516, 1001.9676513672, 89.221527099609) -- Obebedjenje 4
  55. ped[5] = createPed(163, 2149.3081054688, 1603.0529785156, 997.77655029297, 91.664123535156)
  56. ped[6] = createPed(164, 2144.3195800781, 1606.1163330078, 993.568359375, 180.5398406982)
  57. setPedArmor(ped[6], 100)
  58.  
  59.  
  60. setElementInterior(ped[1], 3)
  61. setElementInterior(ped[2], 3)
  62. setElementInterior(ped[3], 1)
  63. setElementInterior(ped[4], 1)
  64. setElementInterior(ped[5], 1)
  65. setElementInterior(ped[6], 1)
  66. for i = 1, #ped, 1 do
  67. setElementDimension(ped[i], dim)
  68. end
  69. setTimer(function()
  70. giveWeapon(ped[1], 27, 500, true)
  71. giveWeapon(ped[2], 31, 500, true)
  72. giveWeapon(ped[3], 27, 500, true)
  73. giveWeapon(ped[4], 31, 500, true)
  74. giveWeapon(ped[5], 27, 500, true)
  75. giveWeapon(ped[6], 31, 500, true)
  76. end, 1000, 1)
  77.  
  78. setElementData(ped[1], "bankguard", true)
  79. setElementData(ped[2], "bankguard", true)
  80. setElementData(ped[3], "bankguard", true)
  81. setElementData(ped[4], "bankguard", true)
  82. setElementData(ped[5], "bankguard", true)
  83. setElementData(ped[6], "bankguard", true)
  84. end
  85. refreshPeds()
  86. local element = {}
  87.  
  88. element["marker1"] = createMarker(593.33087158203, -1250.1072998047, 17.321031188965, "cylinder", 1.0, 0, 255, 0, 150)
  89. -- Draussen: 592.72894287109, -1248.5554199219, 18.159990310669
  90. element["marker2"] = createMarker(367.3508605957, 162.38145446777, 1024.8890625, "cylinder", 1.0, 0, 255, 0, 150)
  91. setElementDimension(element["marker2"], dim)
  92. setElementInterior(element["marker2"], 3)
  93. -- Davor: 365.93826293945, 162.16618347168, 1025.7890625
  94. element["marker3"] = createMarker(351.80215454102, 162.08778381348, 1024.8, "cylinder", 1.0, 0, 255, 0, 150)
  95. setElementDimension(element["marker3"], dim)
  96. setElementInterior(element["marker3"], 3)
  97. -- Davor: 352.91885375977, 162.17353820801, 1025.7890625
  98. element["marker4"] = createMarker(2147.7160644531, 1603.7889404297, 1005.2677246094, "cylinder", 1.0, 0, 255, 0, 150)
  99. setElementDimension(element["marker4"], dim)
  100. setElementInterior(element["marker4"], 1)
  101. -- Davor: 2147.6389160156, 1602.0682373047, 1006.1677246094
  102. element["blip"] = createBlip(593.99407958984, -1248.0634765625, 18.177289962769, 52, 2, 0, 255, 0, 0, 0, 500)
  103.  
  104. addEventHandler("onMarkerHit", element["marker4"], function(hitElement)
  105. if(getElementType(hitElement) == "player") and (isPedInVehicle(hitElement) == false) then
  106. setElementInterior(hitElement, 3)
  107. setElementDimension(hitElement, dim)
  108. setElementPosition(hitElement, 352.91885375977, 162.17353820801, 1025.7890625)
  109. end
  110. end)
  111.  
  112. addEventHandler("onMarkerHit", element["marker3"], function(hitElement)
  113. if(getElementType(hitElement) == "player") and (isPedInVehicle(hitElement) == false) then
  114. if(isPedDead(ped[1])) and (isPedDead(ped[2])) then
  115. setElementInterior(hitElement, 1)
  116. setElementDimension(hitElement, dim)
  117. setElementPosition(hitElement, 2147.6389160156, 1602.0682373047, 1006.1677246094)
  118. triggerClientEvent(hitElement, "onClientBankrobAttackPed", hitElement, ped[3])
  119. triggerClientEvent(hitElement, "onClientBankrobAttackPed", hitElement, ped[4])
  120. triggerClientEvent(hitElement, "onClientBankrobAttackPed", hitElement, ped[5])
  121. triggerClientEvent(hitElement, "onClientBankrobAttackPed", hitElement, ped[6])
  122. else
  123. outputChatBox("Script By xavi.pwn!", hitElement, 0, 255, 255)
  124. end
  125. end
  126. end)
  127.  
  128. addEventHandler("onMarkerHit", element["marker1"], function(hitElement)
  129. if(getElementType(hitElement) == "player") and (isPedInVehicle(hitElement) == false) then
  130. setElementInterior(hitElement, 3)
  131. setElementDimension(hitElement, dim)
  132. setElementPosition(hitElement, 365.93826293945, 162.16618347168, 1025.7890625)
  133. end
  134. end)
  135.  
  136. addEventHandler("onMarkerHit", element["marker2"], function(hitElement)
  137. if(getElementType(hitElement) == "player") and (isPedInVehicle(hitElement) == false) then
  138. setElementInterior(hitElement, 0)
  139. setElementDimension(hitElement, 0)
  140. setElementPosition(hitElement, 592.72894287109, -1248.5554199219, 18.159990310669)
  141.  
  142. end
  143. end)
  144.  
  145. -- UEBERFALL --
  146. element["ueberfallmarker"] = createMarker(2144.2016601563, 1625.419921875, 992.68817138672, "cylinder", 3.0, 0, 255, 0, 20)
  147. setElementInterior(element["ueberfallmarker"], 1)
  148. setElementDimension(element["ueberfallmarker"], dim)
  149.  
  150. element["tresorcol"] = createColSphere(2144.4306640625, 1615.1683349609, 993.68817138672, 20)
  151. setElementInterior(element["tresorcol"], 1)
  152. setElementDimension(element["tresorcol"], dim)
  153.  
  154. addEventHandler("onMarkerHit", element["ueberfallmarker"], function(hitElement)
  155. if(doing == false) then
  156. outputChatBox("Spusti bombu! /bomba", hitElement, 0, 255, 0)
  157. end
  158. end)
  159.  
  160. local markerpos = {
  161. [1] = {2141.9182128906, 1640.9891357422, 993.57611083984},
  162. [2] = {2142.0400390625, 1633.1617431641, 993.57611083984},
  163. [3] = {2142.0808105469, 1637.1442871094, 993.57611083984},
  164. [4] = {2141.880859375, 1629.2978515625, 993.57611083984},
  165. [5] = {2146.7287597656, 1629.2541503906, 993.57611083984},
  166. [6] = {2146.58203125, 1633.1884765625, 993.57611083984},
  167. [7] = {2146.5520019531, 1637.0693359375, 993.57611083984},
  168. [8] = {2146.6931152344, 1641.1104736328, 993.57611083984},
  169. }
  170.  
  171. local explopos = {
  172. [1] = {2151.7736816406, 1615.3994140625, 993.68817138672},
  173. [2] = {2136.6118164063, 1610.7583007813, 993.68817138672},
  174. [3] = {2137.5075683594, 1622.5439453125, 993.68817138672},
  175. [4] = {2137.5075683594, 1622.5439453125, 993.68817138672},
  176.  
  177. }
  178.  
  179. local function createRandomExplosion()
  180. local id = math.random(1, #explopos)
  181. local x, y, z = explopos[id][1], explopos[id][2], explopos[id][3]
  182. local r2 = math.random(1, 2)
  183. if(r2 == 1) then r2 = 1 else r2 = 0 end
  184. createExplosion(x, y, z, r2)
  185. end
  186.  
  187. local function resetBank()
  188. barrels = {
  189. createObject(1222,2153.77124023,1623.12243652,994.38317871,0.00000000,0.00000000,0.00000000), --object(barrel3), (14),
  190. createObject(1222,2155.04418945,1618.16259766,995.15692139,0.00000000,0.00000000,0.00000000), --object(barrel3), (15),
  191. createObject(1222,2154.41943359,1617.46240234,995.15692139,0.00000000,0.00000000,0.00000000), --object(barrel3), (16),
  192. createObject(1222,2153.79736328,1618.64953613,993.16424561,0.00000000,0.00000000,0.00000000), --object(barrel3), (17),
  193. createObject(1222,2151.76367188,1613.64257812,993.16424561,0.00000000,0.00000000,0.00000000), --object(barrel3), (18),
  194. createObject(1222,2148.25390625,1608.07019043,995.40008545,0.00000000,0.00000000,0.00000000), --object(barrel3), (19),
  195. createObject(1222,2147.99389648,1609.18823242,995.40008545,0.00000000,0.00000000,0.00000000), --object(barrel3), (20),
  196. createObject(1222,2146.31274414,1609.05358887,993.16424561,0.00000000,0.00000000,0.00000000), --object(barrel3), (21),
  197. createObject(1222,2147.87939453,1610.77575684,993.16424561,0.00000000,0.00000000,0.00000000), --object(barrel3), (22),
  198. createObject(1222,2141.06420898,1625.57897949,995.29693604,0.00000000,0.00000000,0.00000000), --object(barrel3), (1),
  199. createObject(1222,2142.12011719,1624.64013672,995.29693604,0.00000000,0.00000000,0.00000000), --object(barrel3), (2),
  200. createObject(1222,2147.46215820,1624.57324219,995.29693604,0.00000000,0.00000000,0.00000000), --object(barrel3), (3),
  201. createObject(1222,2148.91308594,1623.70141602,993.16424561,0.00000000,0.00000000,0.00000000), --object(barrel3), (4),
  202. createObject(1222,2147.71752930,1623.47448730,993.16424561,0.00000000,0.00000000,0.00000000), --object(barrel3), (5),
  203. createObject(1222,2132.70410156,1613.04968262,995.29693604,0.00000000,0.00000000,0.00000000), --object(barrel3), (6),
  204. createObject(1222,2132.11596680,1614.04504395,995.29693604,0.00000000,0.00000000,0.00000000), --object(barrel3), (7),
  205. createObject(1222,2134.17236328,1614.76904297,993.16424561,0.00000000,0.00000000,0.00000000), --object(barrel3), (8),
  206. createObject(1222,2136.33496094,1608.22631836,993.16424561,0.00000000,0.00000000,0.00000000), --object(barrel3), (9),
  207. createObject(1222,2136.74145508,1609.32873535,993.16424561,0.00000000,0.00000000,0.00000000), --object(barrel3), (10),
  208. createObject(1222,2137.03515625,1609.25463867,994.41314697,0.00000000,0.00000000,0.00000000), --object(barrel3), (11),
  209. createObject(1222,2131.03247070,1623.24780273,993.16424561,0.00000000,0.00000000,0.00000000), --object(barrel3), (12),
  210. createObject(1222,2153.99218750,1623.33764648,993.16424561,0.00000000,0.00000000,0.00000000), --object(barrel3), (13),
  211. }
  212. for index, object in pairs(barrels) do
  213. setElementInterior(object, 1)
  214. setElementDimension(object, dim)
  215. end
  216. refreshPeds()
  217. doing = false
  218. tresortuer = createObject(2634, 2144.1765136719, 1626.9592285156, 994.27239990234, 0, 0, 180)
  219. setElementInterior(tresortuer, 1)
  220. setElementDimension(tresortuer, dim)
  221. outputChatBox("Banka se oporavila od zasede !", getRootElement(), 0, 200, 200)
  222. for player, index in next, doingbankrob do
  223. doingbankrob[player] = false
  224. erbeutet[player] = 0
  225. end
  226. end
  227.  
  228. local function finishExplosion()
  229. for i = 1, 20, 1 do
  230. setTimer(createRandomExplosion, (i*500), 1)
  231. end
  232. setTimer(function()
  233. for i = 1, 3, 1 do
  234. setTimer(function()
  235. local id = math.random(1, #explopos)
  236. local x, y, z = explopos[id][1], explopos[id][2], explopos[id][3]
  237. createExplosion(x, y, z, 7)
  238. end, 500+(i*100), 1)
  239. end
  240. setTimer(function()
  241. for index, ob in pairs(barrels) do
  242. destroyElement(ob)
  243. end
  244. for i = 1, #markerpos, 1 do
  245. if(isElement(element["robmarker"..i])) then
  246. destroyElement(element["robmarker"..i])
  247. end
  248. end
  249. end, 1000, 1)
  250. end, 5000, 1)
  251. end
  252.  
  253. local function detonateBomb(thePlayer)
  254. for index, player in pairs(getElementsWithinColShape(element["tresorcol"], "player")) do
  255. outputChatBox("Bomba trezora je eksplodirala !", player, 0, 255, 0)
  256. outputChatBox("Bačve sa prahom eksplodiraju. Imate 30-ih godina da ukradete sav novac.", player, 255, 9, 0)
  257. end
  258. triggerClientEvent(getRootElement(), "onBankraubKlingelStart", thePlayer)
  259. for i = 1, 30, 1 do
  260. setTimer(createRandomExplosion, 5000+(i*500), 1)
  261. end
  262. setTimer(finishExplosion, 30*1000, 1)
  263. local x, y, z = getElementPosition(element["bombe"])
  264. destroyElement(element["bombe"])
  265. createExplosion(x, y, z, 0)
  266. destroyElement(tresortuer)
  267. for i = 1, #markerpos, 1 do
  268. element["robmarker"..i] = createMarker(markerpos[i][1], markerpos[i][2], markerpos[i][3]-0.8, "cylinder", 1.0, 0, 255, 0, 50)
  269. local m = element["robmarker"..i]
  270. setElementInterior(m, 1)
  271. setElementDimension(m, dim)
  272. addEventHandler("onMarkerHit", m, function(hitElement)
  273. if(getElementType(hitElement) == "player") then
  274. destroyElement(source)
  275. setPedAnimation(hitElement, "bomber", "BOM_Plant_Loop", -1, true, false, false)
  276. toggleAllControls(hitElement, false)
  277. setTimer(function()
  278. local geld = math.random(5000, 10000)
  279. setPedAnimation(hitElement)
  280. toggleAllControls(hitElement, true)
  281. laSetElementData(hitElement, "money", tonumber(laGetElementData(hitElement, "money"))+geld)
  282. givePlayerMoney(hitElement, geld)
  283. outputChatBox("Opljačkali ste sef $: "..Novac.."", hitElement, 255, 255, 0)
  284. doingbankrob[hitElement] = true
  285. erbeutet[hitElement] = geld
  286. setTimer(function()
  287. doingbankrob[hitElement] = false
  288. erbeutet[hitElement] = 0
  289. end, 60000, 1)
  290. end, 15000, 1)
  291. end
  292. end)
  293. end
  294. end
  295.  
  296. addCommandHandler("bomba", function(thePlayer)
  297. if(doing == false) and (isElementWithinMarker(thePlayer, element["ueberfallmarker"])) --[[and (#getElementsWithinColShape(element["tresorcol"], "player") > 1) ]]then
  298. doing = true
  299. outputChatBox("Bomba lerakva!", getRootElement(), 200, 0, 0)
  300. for index, player in pairs(getElementsWithinColShape(element["tresorcol"], "player")) do
  301. outputChatBox("Bomca ce puknuti za: 5 minuta", player, 255, 255, 0)
  302. end
  303. setTimer(function()
  304. for index, player in pairs(getElementsWithinColShape(element["tresorcol"], "player")) do
  305. outputChatBox("Bomca ce puknuti za: 4 minuta", player, 255, 255, 0)
  306. end
  307. setTimer(function()
  308. for index, player in pairs(getElementsWithinColShape(element["tresorcol"], "player")) do
  309. outputChatBox("Bomca ce puknuti za: 3 minuta", player, 255, 255, 0)
  310. end
  311. setTimer(function()
  312. for index, player in pairs(getElementsWithinColShape(element["tresorcol"], "player")) do
  313. outputChatBox("Bomca ce puknuti za: 2 minuta", player, 255, 255, 0)
  314. end
  315. setTimer(function()
  316. for index, player in pairs(getElementsWithinColShape(element["tresorcol"], "player")) do
  317. outputChatBox("Bomca ce puknuti za: 1 minut", player, 255, 255, 0)
  318. end
  319. setTimer(function()
  320. for index, player in pairs(getElementsWithinColShape(element["tresorcol"], "player")) do
  321. outputChatBox("Bomca ce puknuti za: 10 Sekundi", player, 255, 255, 0)
  322. end
  323. end, 60000, 1)
  324. end, 60000, 1)
  325. end, 60000, 1)
  326. end, 60000, 1)
  327. end, 60000, 1)
  328. setPedAnimation(thePlayer, "bomber", "BOM_Plant_Loop", -1, true, false, false)
  329. toggleAllControls(thePlayer, false)
  330. setTimer(function()
  331. setPedAnimation(thePlayer)
  332. local x, y, z = getElementPosition(thePlayer)
  333. element["bombe"] = createObject(1252, x, y+0.5, z-0.5)
  334. setElementInterior(element["bombe"], 1)
  335. setElementDimension(element["bombe"], dim)
  336. toggleAllControls(thePlayer, true)
  337. setTimer(detonateBomb, 5*60*1000, 1, thePlayer) --[[5*60*1000]]
  338. setTimer(resetBank, 90*60*1000, 1) -- 1.5 LOL: 90*60*1000
  339. end, 10000, 1)
  340. else
  341. outputChatBox("Nakon 1/1 sata, banka je otvorena za daljnje napade", thePlayer, 200, 0, 0)
  342. end
  343. end)
  344.  
  345. -- Igrac Umro --
  346. addEventHandler("onPlayerWasted", getRootElement(), function()
  347. if(doingbankrob[source] == true) then
  348. if(erbeutet[source]) then
  349. doingbankrob[source] = false
  350. local geld = erbeutet[source]
  351. laSetElementData(source, "money", tonumber(laGetElementData(source, "money"))-geld)
  352. outputChatBox("Ubijeni ste, a novac koji ste ukrali je vraćen. Ukupno R $: "..geld.."", source, 255, 0, 0)
  353. end
  354. end
  355. end)
  356.  
  357. addEventHandler("onPlayerQuit", getRootElement(), function(reason)
  358. if(reason ~= "Kicked") and (reason ~= "Pukla Konekcija") then
  359. if(doingbankrob[source] == true) then
  360. if(erbeutet[source]) then
  361. doingbankrob[source] = false
  362. local geld = erbeutet[source]
  363. laSetElementData(source, "money", tonumber(laGetElementData(source, "money"))-geld)
  364. outputChatBox("Ubijeni ste, a novac koji ste ukrali je vraćen. Ukupno R $: "..geld.."", source, 255, 0, 0)
  365. outputChatBox("Igrac "..getPlayerName(source).." je kikovan sa servera jer je prekinuo vezu u trenutku pljačke banke!", getRootElement(), 255, 0, 0)
  366.  
  367. end
  368. end
  369. end
  370. end)
  371.  
  372. function laGetElementData()
  373. return 0
  374. end
  375.  
  376. function laSetElementData()
  377. return 0
  378. end
  379. By xavi.pwn
RAW Paste Data