for(new i=0; i<MAX_PLAYERS; i++){ if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid)) { // player 'i' is in the vehicle. }}