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