Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Excerpt

Determine whether two players are allies with each other.

Availability

3.1 Beta 1 and above.

Syntax

Code Block
themeEclipse
languagejavascript
linenumberstrue
var returnValue = allianceExistsBetween(playerA, playerB);

...

ParameterTypeMandatoryDescriptionGame version
playerANumber(tick)The ID of the first player3.1 Beta 1
playerBNumber(tick)The ID of the second player3.1 Beta 1

Return value

ValueTypeDescriptionGame verison
trueBooleanIndicates that the two players are allied with each other3.1 Beta 1
falseBooleanThe two players are enemies of each other3.1 Beta 1
<error>ErrorOne of the players specified does not exist3.1 Beta 1

Example

Code Block
themeEclipse
languagejavascript
titleShould I attack the other player?
linenumberstrue
if (!allianceExistsBetween(me,theOtherPlayer)) attackTheOtherPlayer();

...