Other great resources: Official JS API docs, Scripting Forum
isMultiplayer
Determine if the game is an online multiplayer game...
Notes
Use this global to determine if your script is running in an online multiplayer game, with multiple human players.
true– Multiplayerfalse– Skirmish, Challenge or Campaign
You can determine whether players are human or AI using the .isAI property in their associated playerData[] Player object.
Example
if (isMultiplayer) {
// multiple human players on the map!
}