Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.13 KB | None | 0 0
  1. --[[
  2. Praca Celebrity Splash
  3.  
  4. @copyright 2015 Yolos
  5. @author Yolos
  6.  
  7. Nie masz prawa używac tego kodu bez mojej zgody.
  8. Napisz do mnie być może się zgodzę na użycie kodu.
  9. ]]--
  10.  
  11. local praca = createMarker(2560.49,-2492.40,13.64-0.8, "cylinder", 2.0, 0, 255, 0, 135)
  12. local t=createElement("text")
  13. setElementData(t,"name", "Praca Splash!")
  14. setElementPosition(t,2560.49,-2492.40,13.64)
  15. setElementDimension(t, 0)
  16. setElementInterior(t, 0)
  17.  
  18.  
  19. local miejscasplash = {
  20. {2569.63,-2480.26,8.58,-0.36},
  21. {2572.35,-2492.28,10.87},
  22. {2570.04,-2469.53,9.15},
  23. }
  24.  
  25. addEventHandler("onClientMarkerHit", praca, function(el, md)
  26. if not md or getElementType(el) ~= "player" then return end
  27. if el ~= localPlayer then return end
  28. outputChatBox("* Zarobki pracy: 15000 EURO za wskoczenie do punktu.")
  29. outputChatBox("* Aby rozpocząć pracę wciśnij 'R'")
  30. end)
  31.  
  32.  
  33. bindKey("r", "down", function()
  34. if not isElementWithinMarker(localPlayer, praca) then return end
  35. if not getElementData(localPlayer, "gracz_praca") then
  36. local losuj = math.random(2, #miejscasplash)
  37. setElementData(localPlayer, "gracz_praca", true)
  38. outputChatBox("* Masz 10 sekund!.", 255, 0, 0)
  39. outputChatBox("* Doskocz do checkpointa!.")
  40. local cel = createMarker(miejscasplash[losuj][1], miejscasplash[losuj][2], miejscasplash[losuj][3]+1.0, "checkpoint", 4.0, 255, 0, 0)
  41. local blip = createBlipAttachedTo(cel, 41)
  42. local czas = setTimer(function()
  43. destroyElement(cel)
  44. destroyElement(blip)
  45. setElementData(localPlayer, "gracz_praca", false)
  46. outputChatBox("* Praca anulowana nie doskoczyłeś!", 255, 0, 0)
  47. end, 10000, 1)
  48.  
  49. addEventHandler("onClientMarkerHit", cel, function(el, md)
  50. if not md or getElementType(el) ~= "player" then return end
  51. if el ~= localPlayer then return end
  52. if isElementInWater(el) then
  53. outputChatBox("* Praca anulowana nie doskoczyłeś!", 255, 0, 0)
  54. setElementPosition(el, -1708.24,188.50,32.99)
  55. setElementData(el, "gracz_praca", false)
  56. destroyElement(blip)
  57. destroyElement(cel)
  58. if isTimer ( czas ) then killTimer (czas) end
  59. return end
  60. if getPedOccupiedVehicle(el) then
  61. outputChatBox("* Nie możesz tego robić będąc w pojeździe!")
  62. return
  63. end
  64. setElementFrozen(el, true)
  65. destroyElement(blip)
  66. if isTimer ( czas ) then killTimer (czas) end
  67. outputChatBox("* Gratulacje doskoczyłeś!")
  68. setTimer(function()
  69. destroyElement(cel)
  70. setElementFrozen(el, false)
  71. setElementData(el, "gracz_praca", false)
  72. triggerServerEvent("givePlayerMoney", el, 7, 5 )
  73. outputChatBox("* Zarobiłeś 15000 PLN!")
  74. setElementPosition(el, 2560.30,-2492.42,13.64)
  75. end, 1500, 1)
  76. end)
  77. else
  78. outputChatBox("* Posiadasz aktywną pracę.")
  79. end
  80. end)
  81.  
  82.  
  83. addEventHandler("onClientResourceStop", resourceRoot, function()
  84. setElementData(localPlayer, "gracz_praca", false)
  85. end,false,"high")
  86.  
  87. fileDelete("praca_c.lua")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement