local districtsBus = {
{-1986.92, 935.31, 45.30},
{-2002.48, 924.51, 45.30},
{-2008.31, 887.55, 45.30},
{-2008.17, 834.59, 45.30},
{-2007.89, 759.92, 45.30},
{-1984.33, 728.10, 45.30},
{-1913.74, 727.53, 45.30},
{-1895.93, 758.23, 45.30-0.2},
{-1895.81, 814.11, 35.51-0.4},
{-1895.44, 867.77, 35.02},
{-1895.12, 909.97, 35.02},
{-1868.51, 920.64, 35.02},
{-1814.47, 920.15, 24.74},
{-1790.50, 957.41, 24.73},
{-1790.08, 1042.79, 31.16-1},
{-1790.48, 1092.34, 45.30},
{-1747.34, 1100.14, 45.29},
{-1710.80, 1122.96, 44.09-0.8},
{-1710.91, 1170.81, 25.47-0.5},
{-1738.79, 1191.10, 24.98},
{-1806.16, 1190.50, 24.97},
{-1864.76, 1181.62, 44.22-0.8},
{-1941.06, 1181.27, 45.30},
{-1968.86, 1134.57, 50.21-0.4},
{-1969.36, 1079.88, 55.57},
{-1929.44, 1051.48, 50.92-0.3},
{-1888.07, 1040.56, 45.18-0.3},
{-1898.95, 973.68, 35.02},
{-1911.91, 934.74, 35.03-0.2},
{-1957.99, 934.49, 43.10-0.4},
{-1979.58, 941.75, 45.45-0.2},
{-1980.02, 955.66, 45.45-0.1},
}
local jobTarget
local jobMarker
local jobVehicle
local maxTarget = #districtsBus
function finishJob()
if jobMarker and isElement(jobMarker) then
destroyElement(jobMarker)
jobMarker = nil
end
if jobTarget and isElement(jobTarget) then
destroyElement(jobTarget)
jobTarget = nil
jobTarget = 0
end
triggerServerEvent("destroyVeh", localPlayer)
end
function busDriver(el, md)
if el ~= localPlayer or not md then return end
if jobTarget > maxTarget and getPedOccupiedVehicle(el) then return end
if jobTarget == maxTarget and not getPedOccupiedVehicle(el) then return end
if jobTarget == #districtsBus then
finishJob()
playSoundFrontEnd(5)
outputChatBox("* Zako?czy?e?(a?) prac?.")
else
local kasa = math.random(8000,13000)
local reputacja = getElementData(el,"player:reputation")
showMarker()
playSoundFrontEnd(12)
if getElementData(el,"player:premium") then
outputChatBox("Otrzymujesz "..kasa.." PLN za zidentyfikowanie punktu.")
setElementData(el,"player:reputation", reputacja+1)
triggerServerEvent("givePlayerMoney", localPlayer, kasa)
else
local kasa2 = math.random(3500,8000)
outputChatBox("* Zidentyfikowa?e?(a?) punkt z drogi i otrzymujesz PLN.")
setElementData(el,"player:reputation", reputacja+1)
triggerServerEvent("givePlayerMoney", localPlayer, kasa2)
outputChatBox("Otrzymujesz "..kasa2.." PLN za zidentyfikowanie punktu.")
end
end
end
function showMarker()
if jobMarker and isElement(jobMarker) then
--outputChatBox("* Sprz?tn??e?(a?) ?mieci z drogi i otrzymujesz 16 PLN.")
--if getElementData(localPlayer,"player:premium") then
--outputChatBox("* Sprz?tn??e?(a?) ?mieci z drogi i otrzymujesz 32 PLN.",localPlayer)
--triggerServerEvent("givePlayerMoney", localPlayer, 32, 0)
--else
--outputChatBox("* Sprz?tn??e?(a?) ?mieci z drogi i otrzymujesz 16 PLN.",localPlayer)
--triggerServerEvent("givePlayerMoney", localPlayer, 16, 0)
destroyElement(jobMarker)
jobMarker = nil
end
jobTarget = jobTarget + 1
jobMarker = createMarker(districtsBus[jobTarget][1], districtsBus[jobTarget][2], districtsBus[jobTarget][3], "checkpoint", 1.75, 255, 255, 255)
if districtsBus[jobTarget+1] then
ile = districtsBus[jobTarget+1]
setMarkerTarget(jobMarker, ile[1], ile[2], ile[3])
end
addEventHandler("onClientMarkerHit", jobMarker, busDriver)
end
addEvent("STARTJobBus", true)
addEventHandler("STARTJobBus", resourceRoot, function(veh)
outputChatBox("* Rozpocz??e?(a?) prac?.")
jobVehicle = veh
jobTarget = 0
showMarker()
end)
addEventHandler("onClientResourceStop", resourceRoot, function()
if jobVehicle and getElementData(localPlayer, "player:job") then
setElementData(localPlayer, "player:job", false)
end
end)
addEventHandler("onClientVehicleExit", resourceRoot, function(plr, seat)
if seat == 0 then
if plr == localPlayer then
finishJob()
outputChatBox("* Zako?czy?e?(a?) prac?.")
end
end
end)
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach