1LoL1 Posted April 16, 2014 Share Posted April 16, 2014 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
Castillo Posted April 16, 2014 Share Posted April 16, 2014 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 ) Link to comment
1LoL1 Posted April 17, 2014 Author Share Posted April 17, 2014 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
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