For alliance:
Try downloading Jass New Gen World Editor and implementing this code:
http://www.hiveworkshop.com/forums/spells-569/alliance-system-155912/
Or if you want to gui the hard way...
Ally Blue
AllyBlue
Events
Player - Player 1 (Red) types a chat message containing -ally blue as An exact match
Player - Player 3 (Teal) types a chat message containing -ally blue as An exact match
Player - Player 4 (Purple) types a chat message containing -ally blue as An exact match
Player - Player 6 (Orange) types a chat message containing -ally blue as An exact match
Player - Player 7 (Green) types a chat message containing -ally blue as An exact match
Player - Player 8 (Pink) types a chat message containing -ally blue as An exact match
Player - Player 9 (Gray) types a chat message containing -ally blue as An exact match
Conditions
Actions
Player - Make (Triggering player) treat Player 2 (Blue) as an Ally with shared vision
Game - Display to (All players) the text: (((Name of (Triggering player)) + has allied with ) + (Name of Player 2 (Blue)))
Sound - Play QuestLog <gen>
Unally Blue
Unallyblue
Events
Player - Player 1 (Red) types a chat message containing -unally blue as An exact match
Player - Player 3 (Teal) types a chat message containing -unally blue as An exact match
Player - Player 4 (Purple) types a chat message containing -unally blue as An exact match
Player - Player 6 (Orange) types a chat message containing -unally blue as An exact match
Player - Player 7 (Green) types a chat message containing -unally blue as An exact match
Player - Player 8 (Pink) types a chat message containing -unally blue as An exact match
Player - Player 9 (Gray) types a chat message containing -unally blue as An exact match
Conditions
Actions
Player - Make (Triggering player) treat Player 2 (Blue) as an Enemy
Player - Make Player 2 (Blue) treat (Triggering player) as an Enemy
Sound - Play UpkeepRing <gen>
Game - Display to (All players) the text: (((Name of (Triggering player)) + declared war on ) + (Name of Player 2 (Blue)))
Repeat that for each color. 9 players, 18 triggers
That's what my map (bottom link) is currently using because I wanted to customize some sound effects etc. You can take a look at the Alliance Folder of the trigger editor for further information. You can feel free to copy and paste the 18 triggers if it saves you time.