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?

Lua Scripter

?ucet=miki_cz

Owner of mshost.cz MTA portal.

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 ) 

The rEvolution is coming ...

Posted

Sounds like this function setVehicleRespawnDelay, doesn't work? or.. it's not used for this kind of script.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

  • Moderators
Posted

Sorry my bad retry with this:

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

The rEvolution is coming ...

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...