Jump to content

Respawn of vehicles


MIKI785

Recommended Posts

Posted

Hi,

I have a small problem

I have a deathmatch and I have some vehicles in it. But if I destroy it it wont respawn. How to make a respawn of these vehicles?

Posted
function respawnVehicles ( ) 
    for i,v in ipairs ( getElementsByType ( 'vehicle' ) ) do 
        setVehicleRespawnDelay ( v, 5000 ) 
    end 
end 
  
addEventHandler ( 'onResourceStart', resourceRoot, respawnVehicles ) 
  

  • Moderators
Posted

Try this:

function respawnTheVehicle( ) 
   setTimer(respawnVehicle, 5000, 1, source ) 
end 
addEventHandler ( "onVehicleExplode", getRootElement(), respawnVehicles ) 

  • Moderators
Posted

Sorry my bad retry with this:

function respawnTheVehicle( ) 
   setTimer(respawnVehicle, 5000, 1, source ) 
end 
addEventHandler ( "onVehicleExplode", getRootElement(), respawnTheVehicle) 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...