Jump to content

Car respawn


Recommended Posts

try this:

function explodeDestroy () 
    local vehicles = getElementsByType( "vehicle" ) 
    for k,v in ipairs( vehicles ) do 
        if ( getElementHealth( v ) < 25 ) then 
            setTimer( destroyElement, 10000, 1, v ) 
        end 
    end 
end 
addEventHandler( "onVehicleExplode", getRootElement (), explodeDestroy ) 

Link to comment
  • 4 weeks later...
  • 2 weeks later...
  50p said:
I posted code responsible for respawn of vehicles in map file looong time ago... https://forum.multitheftauto.com/viewtop ... 70#p280170 (onVehicleExplode) This code will destroy vehicles which were created with createVehicle and vehicles that are not created with your resource. You can delete some of "if" statements to make it work as you want.

So, why deleting vehicles on other resources?

Link to comment

Because that was a question a guy asked... If you have some knowledge about scripting in Lua than you can modify it easily. Every single post of yours doesn't show any skills you have but good luck...

BTW, STOP POSTING SHIT REPLIES IF YOU CAN'T EVEN HELP YOURSELF!

Link to comment

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