Help respawn cars +rep
#6

pawn Код:
forward RACtime();
public RACtime()
{
    static vehID, trailerid;
    new bool:unwanted[CAR_AMOUNT char];

    for(new player=0; player<MAX_PLAYERS; player++)
        if(IsPlayerConnected(player))
        {
            vehID = GetPlayerVehicleID(player);
            if(!(0 < vehID < CAR_AMOUNT)) continue; // if player is not in any vehicle we skip
            unwanted{vehID} = true;

            trailerid = GetVehicleTrailer(vehID);
            if(0 < trailerid < CAR_AMOUNT) // if trailer is attached
                unwanted{trailerid} = true;
        }

    for(new car = 1; car < CAR_AMOUNT; car++)
        if(!unwanted{car} && GetVehicleModel(car) > 0) // or https://sampwiki.blast.hk/wiki/IsValidVehicle instead GetVehicleModel
            SetVehicleToRespawn(car);
}
Reply


Messages In This Thread
Help respawn cars +rep - by KingPersona - 10.05.2015, 21:06
Re: Help respawn cars +rep - by Abagail - 10.05.2015, 21:13
Re: Help respawn cars +rep - by KingPersona - 10.05.2015, 21:26
Re: Help respawn cars +rep - by KingPersona - 11.05.2015, 11:46
Re: Help respawn cars +rep - by KingPersona - 11.05.2015, 17:14
Re: Help respawn cars +rep - by Jefff - 11.05.2015, 19:49

Forum Jump:


Users browsing this thread: 1 Guest(s)