SamsungPLL
Programista lodówek
Wiek: 23 Na forum: 3805 dni Posty: 123
Nick w MP: SamsungPLL
Piwa : 135
Witam, to znowu ja xD
Dzisiaj chcia?bym prosi? o pomoc bo mam ju? po?ow? gotowej pracy ale kolega podes?a? mi pomys? ?eby zrobi? aktualne markery (niebieskie) aby nie dawa?y pieni?dzy, ale zrobi? jeszcze markery bia?e kt?re daje pieni?dze ale freezuj? pojazd na jakies 4 sekundy i po 4 sekundach od-frezzuje pojazd i jedzie dalej. Punkty koloru niebieskie maja prowadzi? do przystank?w kt?re b?d? koloru bia?ego i tak jak pisa?em wy?ej freezowa? pojazd. Prosz? o pomoc Oczywi?cie jak zawsze za pomoc daje
bus_c.lua
local districtsBus = {
{- 1735.86 , 935.60 , 24.74 },
{- 1856.70 , 934.15 , 35.02 },
{- 1976.56 , 929.94 , 45.30 },
{- 2010.05 , 889.21 , 45.30 },
{- 2007.90 , 687.83 , 45.49 },
{- 2009.29 , 164.41 , 27.73 },
{- 2008.72 , - 47.67 , 35.36 },
{- 2024.01 , - 311.14 , 35.52 },
{- 2181.06 , - 314.15 , 35.43 },
{- 2205.83 , - 200.09 , 35.47 },
{- 2338.28 , - 188.65 , 35.36 },
{- 2371.03 , - 75.48 , 35.44 },
{- 2017.15 , - 72.04 , 35.36 },
{- 2005.12 , 48.98 , 31.51 },
{- 1991.66 , 138.80 , 27.73 },
{- 2001.05 , 313.72 , 35.21 },
{- 2000.35 , 594.87 , 35.22 },
{- 2000.49 , 844.61 , 45.49 },
{- 1902.01 , 842.09 , 35.21 },
{- 1897.27 , 916.37 , 35.21 },
{- 1795.58 , 921.17 , 24.93 },
{- 1766.85 , 950.46 , 24.93 },
}
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
showMarker ()
playSoundFrontEnd ( 12 )
triggerServerEvent ( "givePlayerMoney" , localPlayer , 7 , 0 )
end
end
function showMarker ()
if jobMarker and isElement ( jobMarker ) then
destroyElement ( jobMarker )
jobMarker = nil
end
jobTarget = jobTarget + 1
jobMarker = createMarker ( districtsBus [ jobTarget ][ 1 ], districtsBus [ jobTarget ][ 2 ], districtsBus [ jobTarget ][ 3 ], "checkpoint" , 4 , 0 , 0 , 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 , "gracz_praca" ) then
setElementData ( localPlayer , "gracz_praca" , false )
end
end )
addEventHandler ( "onClientVehicleExit" , resourceRoot , function( plr , seat )
if seat == 0 then
if plr == localPlayer then
finishJob ()
outputChatBox ( "* Zako?czy?e? prac?" )
end
end
end )