MIKI785 Posted March 28, 2011 Posted March 28, 2011 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 Owner of mshost.cz MTA portal.
Moderators Citizen Posted March 29, 2011 Moderators Posted March 29, 2011 Hi, SetVehicleRespawnDelay The rEvolution is coming ...
MIKI785 Posted March 30, 2011 Author Posted March 30, 2011 And this will perform on all vehicles? I need that. Lua Scripter Owner of mshost.cz MTA portal.
proracer Posted March 30, 2011 Posted March 30, 2011 function respawnVehicles ( ) for i,v in ipairs ( getElementsByType ( 'vehicle' ) ) do setVehicleRespawnDelay ( v, 5000 ) end end addEventHandler ( 'onResourceStart', resourceRoot, respawnVehicles )
MIKI785 Posted March 30, 2011 Author Posted March 30, 2011 Doesnt work Lua Scripter Owner of mshost.cz MTA portal.
xXNemesiSXx Posted March 30, 2011 Posted March 30, 2011 im a noob on scripting but i think that resourceRoot in the event handler is wrong...
proracer Posted March 30, 2011 Posted March 30, 2011 It's not wrong... Note: every resource has a predefined global variable called resourceRoot whose value is the root element of that resource. https://wiki.multitheftauto.com/wiki/GetResourceRootElement
xXNemesiSXx Posted March 30, 2011 Posted March 30, 2011 so if it isnt wrong the script must work... the meta.xml ?
MIKI785 Posted March 30, 2011 Author Posted March 30, 2011 But it doesnt. I destroyed the car and nothing happened. It dont respawn. Lua Scripter Owner of mshost.cz MTA portal.
Castillo Posted March 30, 2011 Posted March 30, 2011 Download this, and try it. http://www.mediafire.com/?yx4kv93n2kdcj82 San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Moderators Citizen Posted March 31, 2011 Moderators Posted March 31, 2011 Try this: function respawnTheVehicle( ) setTimer(respawnVehicle, 5000, 1, source ) end addEventHandler ( "onVehicleExplode", getRootElement(), respawnVehicles ) The rEvolution is coming ...
MIKI785 Posted March 31, 2011 Author Posted March 31, 2011 Download this, and try it.http://www.mediafire.com/?yx4kv93n2kdcj82 Doesnt work. OMG Lua Scripter Owner of mshost.cz MTA portal.
Castillo Posted April 1, 2011 Posted April 1, 2011 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. Education is the most powerful weapon which you can use to change the world.
Moderators Citizen Posted April 1, 2011 Moderators Posted April 1, 2011 Sorry my bad retry with this: function respawnTheVehicle( ) setTimer(respawnVehicle, 5000, 1, source ) end addEventHandler ( "onVehicleExplode", getRootElement(), respawnTheVehicle) The rEvolution is coming ...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now