Overview
Determine whether two players are allies with each other.Syntax
var returnValue = allianceExistsBetween(playerA, playerB);
Parameters
Parameter | Type | Mandatory | Description |
---|---|---|---|
playerA | Number | The ID of the first player | |
playerB | Number | The ID of the second player |
Return value
Value | Type | Description |
---|---|---|
true | Boolean | Indicates that the two players are allied with each other |
false | Boolean | The two players are enemies of each other |
<error> | Error | One of the players specified does not exist |
Example
Should I attack the other player?
if (!allianceExistsBetween(me,theOtherPlayer)) attackTheOtherPlayer();
See Also
- 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