Other great resources: Official JS API docs, Scripting Forum
allianceExistsBetween()
- Aubergine
Owned by Aubergine
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();
Availability 3.1 B1+
Requires:
- Warzone 3.1 Beta 1 or above.
Contents
Jump to:
See also
Related articles:
- setAlliance() – form or break an alliance between two players
- 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