25.12.2009, 23:24
GetDriverID(vehicleid)
vehicleid - ID of the vehicle you want to return the driver's playerid from
vehicleid - ID of the vehicle you want to return the driver's playerid from
pawn Код:
stock GetDriverID(vehicleid)
{
for( new i = 0; i < MAX_PLAYERS; i++ )
{
if( GetPlayerState( i ) == PLAYER_STATE_DRIVER && GetPlayerVehicleID( i ) == vehicleid )
return i;
}
return INVALID_PLAYER_ID;
}