well for all you people out there trying to make castlewars, and dont want the capes getting into the wrong hands (lol) heres some perfect code for portals. as in perfect, i mean you cant get out with a cape, it wont disconnect you if you dont have a cape, and you cant take the cape off.

be gratefull...

Code:
	if (objectID == 4390) {// Zamorak Portal leave
		if(playerEquipment[playerCape] == 4042) {
		  remove(playerEquipment[playerCape], playerCape);
		    deleteItem(4042, GetItemSlot(4042), 1);
	Sara = false;
	Sara = false;
	server.cwarssaramax -= 1;
		teleportToX = 2441+misc.random(3);
		teleportToY = 3089+misc.random(3);
		sendFrame126("                                                       ", 6572);
		appearanceUpdateRequired = true;
		UpdateAll();
	} else { 
	Sara = false;
	Sara = false;
	server.cwarssaramax -= 1;
		teleportToX = 2441+misc.random(3);
		teleportToY = 3089+misc.random(3);
		sendFrame126("                                                       ", 6572);
		appearanceUpdateRequired = true;
		UpdateAll();
		}
	}

	if (objectID == 4389) { // Saradomin Portal leave
		if(playerEquipment[playerCape] == 4041) {
		  remove(playerEquipment[playerCape], playerCape);
		    deleteItem(4041, GetItemSlot(4041), 1);
	Sara = false;
	Sara = false;
	server.cwarssaramax -= 1;
		teleportToX = 2441+misc.random(3);
		teleportToY = 3089+misc.random(3);
		sendFrame126("                                                       ", 6572);
		appearanceUpdateRequired = true;
		UpdateAll();
	} else { 
	Sara = false;
	Sara = false;
	server.cwarssaramax -= 1;
		teleportToX = 2441+misc.random(3);
		teleportToY = 3089+misc.random(3);
		sendFrame126("                                                       ", 6572);
		appearanceUpdateRequired = true;
		UpdateAll();
		}
	}