Overview
Determine whether two players are allies with each other.Availability
3.1 Beta 1 and above.
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();
See Also
- alliancesType – indicates which alliance mode is selected for the current game
- maxPlayers – defines how many players are on the map
- playerData – some extra info about players, including what team they are in (if applicable)
- Players & Alliances – other player / alliance related stuff