Advertisement
Guest User

Untitled

a guest
Apr 30th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.62 KB | None | 0 0
  1. busjob = {marker = 0, insgesamtmarker = 10}
  2.  
  3. busjob.positions = {
  4. [1] = {-1531.7939453125, 966.376953125, 7.0390625-0.8},
  5. [2] = {-1635.2587890625, 1256.6435546875, 7.0468425750732-0.8},
  6. --[3] = {-1986.6787109375, 1314.0126953125, 7.0390625-0.8},
  7. --[4] = {-2624.1162109375, 1314.4970703125, 7.0468578338623-0.8},
  8. --[5] = {-2857.1201171875, 379.259765625, 4.3515625-0.8},
  9. --[6] = {-2603.384765625, 449.6748046875, 14.453125-0.8},
  10. --[7] = {-2028.7490234375, 500.646484375, 35.015625-0.8},
  11. --[8] = {-1867.8095703125, 600.6123046875, 35.015625-0.8},
  12. --[9] = {-1623.208984375, 725.3203125, 14.4609375},
  13. --[10] = {-1526.1953125, 784.80859375, 7.1805419921875}
  14. }
  15.  
  16. function busjob.create()
  17. if isElement(newmarker) then
  18. destroyElement(newmarker)
  19. end
  20. if isElement(blip) then
  21. destroyElement(blip)
  22. end
  23.  
  24. busjob.marker = busjob.marker + 1
  25. newmarker = createMarker(busjob.positions[busjob.marker][1], busjob.positions[busjob.marker][2], busjob.positions[busjob.marker][3], "cylinder", 3, 0, 0, 255)
  26. blip = createBlip(busjob.positions[busjob.marker][1], busjob.positions[busjob.marker][2], busjob.positions[busjob.marker][3],0,2,0,255,0)
  27.  
  28. addEventHandler("onClientMarkerHit",newmarker,function(player)
  29. if player == localPlayer then
  30. local veh = getPedOccupiedVehicle(localPlayer)
  31. local sx, sy, sz = getElementVelocity (getPedOccupiedVehicle(getLocalPlayer()))
  32. local kmh_s = math.floor(((sx^2 + sy^2 + sz^2)^(0.5))*180)
  33. local str = string.format("%03d", kmh_s)
  34.  
  35. if tonumber(str) <= 50 then
  36. setElementFrozen(veh, true)
  37. setTimer(function()
  38. if busjob.marker < busjob.insgesamtmarker then
  39. busjob.create()
  40. else
  41. busjob.marker = 0
  42. busjob.create()
  43. givePlayerMoney(player, 2500)
  44. if isElement(newmarker) then
  45. destroyElement(newmarker)
  46. end
  47. if isElement(blip) then
  48. destroyElement(blip)
  49. end
  50. end
  51. setElementFrozen(veh, false)
  52. end,4000,1)
  53. else
  54. outputChatBox("Du bist zu schnell! 50 KM/H!", 125, 0, 0)
  55. end
  56. end
  57. end)
  58. end
  59. addEvent("createBusjobMarker", true)
  60. addEventHandler("createBusjobMarker", root, busjob.create)
  61.  
  62. addEvent("destroyBusjobMarker",true)
  63. addEventHandler("destroyBusjobMarker",root,function()
  64. if isElement(newmarker) then
  65. destroyElement(newmarker)
  66. end
  67. if isElement(blip) then
  68. destroyElement(blip)
  69. end
  70. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement