26.07.2016, 03:11
(
Последний раз редактировалось Gammix; 26.07.2016 в 04:00.
)
Vehicle occupancy function:
Respawn all unoccupied vehicles:
EDIT: Fixed returns.
pawn Код:
IsVehicleOccupied(vehicleid)
{
foreach (new i : Player)
{
if (GetPlayerVehicleID(i) == vehicleid)
return 1;
}
return 0;
}
pawn Код:
for(new i = 1, j = GetVehiclePoolSize(); i <= j; i++)
{
if (IsValidVehicle(i))
{
if (!IsVehicleOccupied(i))
SetVehicleToRespawn(i);
}
}