22.07.2012, 10:38
pawn Код:
stock WhoIsDriver(vehicleid)
{
for(new i = 0; i < MAX_PLAYERS; i++) //Loops through all players
{
if(GetPlayerVehicleID(i) == vehicleid && GetPlayerState(i) == PLAYER_STATE_DRIVER) return i; //Returns playerid if the player is in the vehicleid provided AND is the driver
}
return 1;
}