xbenny2506x Posted July 7, 2009 Share Posted July 7, 2009 Hi I have a new problem nothing new for me lol When a player leave the server and he is a vehicle the vehicle dont respawn back on the .map place. Here are my idle script: function idleRespawn () for i,vehicle in ipairs(getElementsByType("vehicle")) do toggleVehicleRespawn(vehicle, true) setVehicleIdleRespawnDelay(vehicle, 20000) end end addEventHandler("onResourceStart", getRootElement(), idleRespawn ) i have a vehicle explode script too addEventHandler( "onVehicleExplode", getRootElement( ), function( ) local parent = getElementParent( source ) if getElementType( parent ) == "map" and getElementID( parent ) ~= "dynamic" then setTimer( respawnVehicle, 80000, 1, source ) else setTimer( destroyElement, 5000, 1, source ) end end ) All scripts work very good only when a player is in a vehicle and leave the sever the vehicle dont respawn on the old .map place. Can someone help me plz THX Link to comment
xbenny2506x Posted July 8, 2009 Author Share Posted July 8, 2009 I have test this: function leaveplayer () for i,vehicle in ipairs(getElementsByType("vehicle")) do toggleVehicleRespawn(vehicle, true) setVehicleIdleRespawnDelay(vehicle, 10000) end end addEventHandler("onPlayerQuit", getRootElement(), leaveplayer ) onPlayerQuit when the player leave the server but nothing When the player is in a vehicle and leave then the server the vehicle didn't respawn on the old .map place. Can someone help me with that problem PLZ! Link to comment
50p Posted July 8, 2009 Share Posted July 8, 2009 It seems like MTA bug. Maybe it's caused by synching vehicles when player leaves to let the vehicle be in the same place when player leaves the server so that other players can see it there, but IMO it should respawn the vehicle even when player was in it before he/she left. Link to comment
xbenny2506x Posted July 9, 2009 Author Share Posted July 9, 2009 Oh a mta bug that is bad I have add now all vehicles in a new .zip file (vehicles.zip) with a meta.xml. vehicles.map... Is there a way that the vehicles.zip file restart all 30mins new, so that the vehicles all on the old place all 30mins? Link to comment
50p Posted July 9, 2009 Share Posted July 9, 2009 You need to make another resource which will restart this vehicles resource. Just put this inside the new resource which will restart the vehicles resource: addEventHandler( "onResourceStart", getRootElement(), function( resourceStarted ) if( getResourceName( resourceStarted ) == "vehicles" ) then setTimer( restartResource, 1800000, 1, resourceStarted ); end end ) Remember to give this resource access to restartResource function. Open acl.xml and find Admin group, add a node inside of that group: ... name="Admin"> .... name="resource.THIS_NEW_RESOUCE_NAME" /> >... 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