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