public static void removePlayingPlayer(Player player, int team) {
		playing[team].remove(player);
		player.reset();
		player.setCanPvp(false);

		// remove the items
		setCape(player, null);
		int weaponId = player.getEquipment().getWeaponId();
		if (weaponId == 4037 || weaponId == 4039) {
			CastleWars.setWeapon(player, null);
			CastleWars.dropFlag(player.getLastWorldTile(),
					weaponId == 4037 ? CastleWars.SARADOMIN
							: CastleWars.ZAMORAK);
		}
		player.getInventory().deleteItem(4049, Integer.MAX_VALUE); // bandages
		player.getInventory().deleteItem(4053, Integer.MAX_VALUE); // barricades

		player.getHintIconsManager().removeUnsavedHintIcon();
		player.getMusicsManager().reset();
		player.setNextWorldTile(new WorldTile(LOBBY, 2));
		if (playingGame != null && waiting[team].size() == 0
				&& playing[team].size() == 0)
			destroyPlayingGame(); // cancels if 0 players playing/waiting on any
									// of the tea
	}