Jump to content

[HELP] Cars


1LoL1

Recommended Posts

It could not be done in this script so that it could be gone from the server only cars that have already exploded? or are in the water ..? please help

function allvehiclesaredoomed() 
    vehicles = getElementsByType("vehicle") 
    for i,v in ipairs(vehicles) do 
        destroyElement(v) 
    end 
end 
addCommandHandler("destroyall", allvehiclesaredoomed) 

Link to comment
You must use isVehicleBlown and isElementInWater.
function allvehiclesaredoomed ( ) 
    local vehicles = getElementsByType ( "vehicle" ) 
    for _, v in ipairs ( vehicles ) do 
        if ( isVehicleBlown ( v ) or isElementInWater ( v ) ) then 
            destroyElement ( v ) 
        end 
    end 
end 
addCommandHandler ( "destroyall", allvehiclesaredoomed ) 

Thanks.

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