Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function DelVeh( world )
- {
- local to = typeof(world), vehCount = GetVehicleCount();
- //See if the world is a integer or not.
- if( to != "integer" ) throw "Expected (int), got ("+to+")";
- //loop through all the vehicles
- for(local veh, i = 0; i < vehCount; i++ ){
- //Get the instance of the vehicle.
- veh = FindVehicle(i);
- //See if the vehicle exists and it's world is same as the parameter.
- if( veh && veh.World == world ){
- //Uncomment this if you don't want your console spammed :P
- print("Deleting vehicle number " + veh.ID );
- //And finally, delete the vehicle
- veh.Delete();
- }
- }
- }
Add Comment
Please, Sign In to add comment