Is Vehicle Occupied
#2

Mm; I guess you could do something like:

pawn Код:
stock GetVehicleDriver(vid)
{
     for(new i; i < GetMaxPlayers(); i++)
     {
          if(!IsPlayerConnected(i)) continue;
          if(GetPlayerVehicleID(i) == vid && GetPlayerSeat(playerid) == 0) return i;
     }
     return INVALID_PLAYER_ID;
}
Usage: GetVehicleDriver(vehicleid)
if the vehicle is occupied. It will return the drivers player id. If it is not occupied it will return INVALID_PLAYER_ID.
Reply


Messages In This Thread
IsVehicleOccupied - by [DOG]irinel1996 - 04.06.2011, 00:50
Re: Is Vehicle Occupied - by Ash. - 04.06.2011, 00:57

Forum Jump:


Users browsing this thread: 1 Guest(s)