On my server, several users leave the cars launched, could someone give me the command to respawn all vehicles? ;D
I'll give you two ways.
Copy this function and paste it anywhere:-
function RespawnVehicles( rtime = 0 ){
//Loop over all the vehicles.
for( local veh, i = 1; i <= 1000; i++ ){
veh = FindVehicle(i);
if( !veh ) continue;
if( rtime == 0 ) veh.Respawn();
else veh.RespawnTimer = rtime; //Time in ms.
}
}
1. Command:-
if( cmd == "rveh" ){
RespawnVehicles();
}
That will respawn all vehicles.
And, if you want automatic respawn, i.e, vehicles respawn after a certain time, then pass a time to it.
For ex: RespawnVehicles(60000);
This code will make the vehicles respawn themselves every 1 min( 60 seconds )
Thanks Bro :)