vehicle seat question
#4

pawn Код:
stock GetEmptyVehicleSeat(vehicleid)
{
    new bool:Seat[4];
    for(new i;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsPlayerInVehicle(i,vehicleid))
            {
                if(GetPlayerVehicleSeat(i) == 0) Seat[0] = true;
                if(GetPlayerVehicleSeat(i) == 1) Seat[1] = true;
                if(GetPlayerVehicleSeat(i) == 2) Seat[2] = true;
                if(GetPlayerVehicleSeat(i) == 3) Seat[3] = true;
            }
        }
    }
    for(new a;a<sizeof(Seat);a++)
    {
        if(Seat[a] == false) return a;
    }
    return -1;
}
Returns -1 if there isnt a free seat.
Reply


Messages In This Thread
vehicle seat question - by Tigerkiller - 18.09.2011, 12:15
Re: vehicle seat question - by =WoR=Varth - 18.09.2011, 12:18
Re: vehicle seat question - by Tigerkiller - 18.09.2011, 12:24
Re: vehicle seat question - by wouter0100 - 18.09.2011, 12:26
Re: vehicle seat question - by Tigerkiller - 18.09.2011, 12:32

Forum Jump:


Users browsing this thread: 2 Guest(s)