local marker_rozpoczecia = createMarker(2532.49,-2260.66,2,"cylinder",2,0,0,150,150)
setElementData(marker_rozpoczecia,"marker_opis","Praca dorywcza - Nurek")
local marker_zakonczenia = createMarker(2529.24,-2251.98,2.00,"cylinder",2,0,0,150,150)
setElementData(marker_zakonczenia,"marker_opis","Zako?cz prace - Nurka")
local blip = createBlipAttachedTo(marker_rozpoczecia,34)
local punkty_nurka = {
{2453.7329101563, -2290.8962402344, -8.1344356536865},
{2459.8908691406, -2330.0866699219, -8.1344356536865},
{2503.4125976563, -2306.0537109375, -15.659435272217},
{2574.2963867188, -2255.0654296875, -6.0344352722168},
{2613.8046875, -2301.2021484375, -12.234435081482},
{2479.4670410156, -2339.2680664063, -3.4344353675842},
{2370.486328125, -2410.6625976563, -14.134435653687},
{2455.5871582031, -2275.7622070313, -5.3344354629517},
{2708.1066894531, -2286.8937988281, -5.3344354629517},
}
addEventHandler("onClientMarkerHit",marker_rozpoczecia,
function (el)
if el ~= localPlayer then return end
if getElementData(el,"pracaNurka") then return end
setPedOxygenLevel(el,4000)
toggleControl("fire", true)
cele()
setElementData(el,"pracaNurka",true)
end
)
addEventHandler("onClientMarkerHit",marker_zakonczenia,
function (el)
if el ~= localPlayer then return end
if not getElementData(el,"pracaNurka") then return end
setPedOxygenLevel(el,1000)
destroyElement(cel)
destroyElement(blip)
toggleControl("fire", false)
toggleControl("next_weapon", false)
end
)
function cele (el)
if el ~= localPlayer then return end
local rnd = punkty_nurka[math.random(1,#punkty_nurka)]
cel = createMarker(rnd[1], rnd[2], rnd[3], "ring", 2, 255, 0, 0, 200)
blip = createBlipAttachedTo(cel,41,2)
local function zebral (el)
if el ~= localPlayer then return end
local money = math.random(15,20)
destroyElement(cel)
destroyElement(blip)
outputChatBox("Otrzymujesz "..money.." EUR za wy?owienie ?mieci!")
triggerServerEvent("kasaNurek",getRootElement(),el,money)
cele()
end
addEventHandler("onClientMarkerHit",cel,zebral)
end