Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Praca Celebrity Splash
- @copyright 2015 Yolos
- @author Yolos
- Nie masz prawa używac tego kodu bez mojej zgody.
- Napisz do mnie być może się zgodzę na użycie kodu.
- ]]--
- local praca = createMarker(2560.49,-2492.40,13.64-0.8, "cylinder", 2.0, 0, 255, 0, 135)
- local t=createElement("text")
- setElementData(t,"name", "Praca Splash!")
- setElementPosition(t,2560.49,-2492.40,13.64)
- setElementDimension(t, 0)
- setElementInterior(t, 0)
- local miejscasplash = {
- {2569.63,-2480.26,8.58,-0.36},
- {2572.35,-2492.28,10.87},
- {2570.04,-2469.53,9.15},
- }
- addEventHandler("onClientMarkerHit", praca, function(el, md)
- if not md or getElementType(el) ~= "player" then return end
- if el ~= localPlayer then return end
- outputChatBox("* Zarobki pracy: 15000 EURO za wskoczenie do punktu.")
- outputChatBox("* Aby rozpocząć pracę wciśnij 'R'")
- end)
- bindKey("r", "down", function()
- if not isElementWithinMarker(localPlayer, praca) then return end
- if not getElementData(localPlayer, "gracz_praca") then
- local losuj = math.random(2, #miejscasplash)
- setElementData(localPlayer, "gracz_praca", true)
- outputChatBox("* Masz 10 sekund!.", 255, 0, 0)
- outputChatBox("* Doskocz do checkpointa!.")
- local cel = createMarker(miejscasplash[losuj][1], miejscasplash[losuj][2], miejscasplash[losuj][3]+1.0, "checkpoint", 4.0, 255, 0, 0)
- local blip = createBlipAttachedTo(cel, 41)
- local czas = setTimer(function()
- destroyElement(cel)
- destroyElement(blip)
- setElementData(localPlayer, "gracz_praca", false)
- outputChatBox("* Praca anulowana nie doskoczyłeś!", 255, 0, 0)
- end, 10000, 1)
- addEventHandler("onClientMarkerHit", cel, function(el, md)
- if not md or getElementType(el) ~= "player" then return end
- if el ~= localPlayer then return end
- if isElementInWater(el) then
- outputChatBox("* Praca anulowana nie doskoczyłeś!", 255, 0, 0)
- setElementPosition(el, -1708.24,188.50,32.99)
- setElementData(el, "gracz_praca", false)
- destroyElement(blip)
- destroyElement(cel)
- if isTimer ( czas ) then killTimer (czas) end
- return end
- if getPedOccupiedVehicle(el) then
- outputChatBox("* Nie możesz tego robić będąc w pojeździe!")
- return
- end
- setElementFrozen(el, true)
- destroyElement(blip)
- if isTimer ( czas ) then killTimer (czas) end
- outputChatBox("* Gratulacje doskoczyłeś!")
- setTimer(function()
- destroyElement(cel)
- setElementFrozen(el, false)
- setElementData(el, "gracz_praca", false)
- triggerServerEvent("givePlayerMoney", el, 7, 5 )
- outputChatBox("* Zarobiłeś 15000 PLN!")
- setElementPosition(el, 2560.30,-2492.42,13.64)
- end, 1500, 1)
- end)
- else
- outputChatBox("* Posiadasz aktywną pracę.")
- end
- end)
- addEventHandler("onClientResourceStop", resourceRoot, function()
- setElementData(localPlayer, "gracz_praca", false)
- end,false,"high")
- fileDelete("praca_c.lua")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement