01.09.2014, 10:14
Quote:
Loop from 0 to 23 (because if you loop to 22 the last car wont be deleted)
then use (IsVehicleOccuiped) function if no one is in the car then DestroyVehicle() I'll post an example later since I'm on phone right now. |
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.
}
pawn Код:
stock IsVehicleOccupied(vehid)
{
for( new all = 0; all < MAX_PLAYERS; all++)
{
if (IsPlayerInVehicle(all, vehid))
{
return 1;
}
}
return 0;
}