Other great resources: Official JS API docs, Scripting Forum
allianceExistsBetween()
Determine whether two players are allies with each other...
Syntax
var returnValue = allianceExistsBetween(playerA, playerB);Parameters
Parameter | Type | Mandatory | Description | Game version |
|---|---|---|---|---|
playerA | Number | The ID of the first player | 3.1 Beta 1 | |
playerB | Number | The ID of the second player | 3.1 Beta 1 |
Return value
Value | Type | Description | Game verison |
|---|---|---|---|
true | Boolean | Indicates that the two players are allied with each other | 3.1 Beta 1 |
false | Boolean | The two players are enemies of each other | 3.1 Beta 1 |
<error> | Error | One of the players specified does not exist | 3.1 Beta 1 |
Example
Should I attack the other player?
if (!allianceExistsBetween(me, theOtherPlayer)) attackTheOtherPlayer();