07.02.2010, 23:03
pawn Код:
stock GetVehicleDriver(vehicle) //the function
{
for(new i=0; i<MAX_PLAYERS, IsPlayerConnected(i); i++) //check for every connected players
{
if(GetPlayerVehicleID(i) == vehicle && GetPlayerState(i) == PLAYER_STATE_DRIVER) return i; //if the player chechek drives the car it returns his ID
}
return INVALID_PLAYER_ID; //else it returns INVALID_PLAYER_ID
}