Hi. I need help making a command that destroys all vehicles spawned with a command
#3

Create a variable that stores all the spawned vehicles.
Код:
new spawned_vehicles[MAX_PLAYERS][MAX_VEHICLES];
Once you spawn a vehicle, assign it's id to the variable.
Код:
spawned_vehicles[playerid][vehicleid] = 1; // '1' means that the vehicle is spawned.
When you want to destroy all player's spawned vehicles, use:
Код:
for(new i = 0; i < MAX_VEHICLES; i++)
{
if(spawned_vehicles[playerid][i] == 1)
{
DestroyVehicle(i);
spawned_vehicles[playerid][i] = 0;
}
}
Reply


Messages In This Thread
Hi. I need help making a command that destroys all vehicles spawned with a command - by MoeSal - 24.01.2014, 00:28
Re: Hi. I need help making a command that destroys all vehicles spawned with a command - by Don_Cage - 24.01.2014, 00:58
Re: Hi. I need help making a command that destroys all vehicles spawned with a command - by Shetch - 24.01.2014, 01:22
Re: Hi. I need help making a command that destroys all vehicles spawned with a command - by Don_Cage - 24.01.2014, 01:26

Forum Jump:


Users browsing this thread: 1 Guest(s)