polaczkos
Wiek: 25 Na forum: 4085 dni Posty: 168
Nick w MP: polaczkos
Piwa : 3
Witam chodzi o to ?eby po wjechaniu w ostatni punkt usuwa?o pojazd ale nie dzia?a mi to a b??d?w w DB nie
Spawn pojazdu
for i , v in ipairs ( busy ) do
local busy = createVehicle ( 431 , v [ 1 ], v [ 2 ], v [ 3 ])
setElementData ( busy , "vopis" , "Kierowca Autobusu" )
setVehiclePlateText ( busy , "Autobus" )
setVehicleColor ( busy , 255 , 0 , 0 )
setVehicleRotation ( busy , v [ 4 ], v [ 5 ], v [ 6 ])
setVehicleHandling ( busy , "maxVelocity" , 150 )
setElementData ( busy , "pojazdy_przebieg" , math . random ( 500 , 1000 ))
setElementData ( busy , "pojazdy_paliwo" , 50 )
setVehicleHandling ( busy , "maxVelocity" , 80.0 )
setVehicleHandling ( busy , "driveType" , "rwd" )
setVehicleHandling ( busy , "engineType" , "diesel" )
setElementFrozen ( busy , true )
setVehicleEngineState ( busy , false )
end
function respawnVehicles ()
for i , v in ipairs ( getElementsByType ( "vehicle" , resourceRoot )) do
if not getVehicleOccupant ( v ) then
respawnVehicle ( v )
setElementFrozen ( v , true )
setElementData ( v , "vopis" , "Kierowca Autobusu" )
setVehicleColor ( v , 255 , 0 , 0 )
setVehicleRotation ( v , 0 , 0 , 240 )
setVehicleHandling ( v , "maxVelocity" , 150 )
setElementData ( v , "pojazdy_przebieg" , math . random ( 500 , 1000 ))
setElementData ( v , "pojazd_paliwo" , 50 )
setVehicleHandling ( v , "maxVelocity" , 80.0 )
setVehicleHandling ( v , "driveType" , "rwd" )
setVehicleHandling ( v , "engineType" , "diesel" )
setVehicleEngineState ( v , false )
end
end
end
setTimer ( respawnVehicles , 5000 , 0 )
addEvent ( "checkCars" , true )
addEventHandler ( "checkCars" , resourceRoot , respawnVehicles )
Usuwanie pojazdu
addEvent ( "Usun_Pojazd" , true )
addEventHandler ( "Usun_Pojazd" , getRootElement (),
function()
for i , v in ipairs ( busy ) do
if v [ source ] then
if isElement ( v [ source ]) then destroyElement ( v [ source ]) end
end
end
end )
wywo?anie usun pojazd przy ostatnim punkcje
if Praca_Target == #Wiejska_Trasa then
triggerServerEvent ( "Usun_Pojazd" , localPlayer )
Koniec_Pracy ()
playSoundFrontEnd ( 5 )
outputChatBox ( "[INFO] Koniec trasy " , 0 , 155 , 255 )
Prosze o pomoc