Respawn all unoccupied vehicles
#4

Vehicle occupancy function:
pawn Код:
IsVehicleOccupied(vehicleid)
{
    foreach (new i : Player)
    {
        if (GetPlayerVehicleID(i) == vehicleid)
            return 1;
    }
    return 0;
}
Respawn all unoccupied vehicles:
pawn Код:
for(new i = 1, j = GetVehiclePoolSize(); i <= j; i++)
{
    if (IsValidVehicle(i))
    {
        if (!IsVehicleOccupied(i))
            SetVehicleToRespawn(i);
    }
}
EDIT: Fixed returns.
Reply


Messages In This Thread
Respawn all unoccupied vehicles - by yvoms - 25.07.2016, 22:09
Re: Respawn all unoccupied vehicles - by VVWVV - 25.07.2016, 23:15
Re: Respawn all unoccupied vehicles - by Abagail - 26.07.2016, 00:55
Re: Respawn all unoccupied vehicles - by Gammix - 26.07.2016, 03:11
Re: Respawn all unoccupied vehicles - by Threshold - 26.07.2016, 03:54

Forum Jump:


Users browsing this thread: 1 Guest(s)