MIKI785 Posted March 28, 2011 Share 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? Link to comment
Moderators Citizen Posted March 29, 2011 Moderators Share Posted March 29, 2011 Hi, SetVehicleRespawnDelay Link to comment
MIKI785 Posted March 30, 2011 Author Share Posted March 30, 2011 And this will perform on all vehicles? I need that. Link to comment
proracer Posted March 30, 2011 Share Posted March 30, 2011 function respawnVehicles ( ) for i,v in ipairs ( getElementsByType ( 'vehicle' ) ) do setVehicleRespawnDelay ( v, 5000 ) end end addEventHandler ( 'onResourceStart', resourceRoot, respawnVehicles ) Link to comment
xXNemesiSXx Posted March 30, 2011 Share Posted March 30, 2011 im a noob on scripting but i think that resourceRoot in the event handler is wrong... Link to comment
proracer Posted March 30, 2011 Share 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 Link to comment
xXNemesiSXx Posted March 30, 2011 Share Posted March 30, 2011 so if it isnt wrong the script must work... the meta.xml ? Link to comment
MIKI785 Posted March 30, 2011 Author Share Posted March 30, 2011 But it doesnt. I destroyed the car and nothing happened. It dont respawn. Link to comment
Castillo Posted March 30, 2011 Share Posted March 30, 2011 Download this, and try it. http://www.mediafire.com/?yx4kv93n2kdcj82 Link to comment
Moderators Citizen Posted March 31, 2011 Moderators Share Posted March 31, 2011 Try this: function respawnTheVehicle( ) setTimer(respawnVehicle, 5000, 1, source ) end addEventHandler ( "onVehicleExplode", getRootElement(), respawnVehicles ) Link to comment
MIKI785 Posted March 31, 2011 Author Share Posted March 31, 2011 Download this, and try it.http://www.mediafire.com/?yx4kv93n2kdcj82 Doesnt work. OMG Link to comment
Castillo Posted April 1, 2011 Share Posted April 1, 2011 Sounds like this function setVehicleRespawnDelay, doesn't work? or.. it's not used for this kind of script. Link to comment
Moderators Citizen Posted April 1, 2011 Moderators Share Posted April 1, 2011 Sorry my bad retry with this: function respawnTheVehicle( ) setTimer(respawnVehicle, 5000, 1, source ) end addEventHandler ( "onVehicleExplode", getRootElement(), respawnTheVehicle) Link to comment
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