Here's an example:
pawn Код:
// Somewhere in your code (A command for example)
for (new i = 0; i < 23; i++)
{
if (!IsVehicleOccupied(car[i])) DestroyVehicle(car[i]); // Use SetVehicleToRespawn(car[i]); if you want them to respawn instead of getting destroyed.
}
Here's the IsVehicleOccupied function.
pawn Код:
stock IsVehicleOccupied(vehid)
{
for( new all = 0; all < MAX_PLAYERS; all++)
{
if (IsPlayerInVehicle(all, vehid))
{
return 1;
}
}
return 0;
}
Should work.