03.12.2016, 14:22
You can do this way:
PHP код:
IsVehicleEmpty(vehicleid)
{
for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
{
if(IsPlayerInVehicle(i, vehicleid)) return 0;
}
return 1;
}
COMMAND:destroyveh(playerid,params[])
{
for(new i = 1, j = GetVehiclePoolSize(); i <= j; i++) // vehicleids start at 1
{
if(IsVehicleEmpty(i)) DestroyVehicle(i);
}
return 1;
}