Other great resources: Official JS API docs, Scripting Forum

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Overview

Determine whether two players are allies with each other.

Availability

3.1 Beta 1 and above.

Syntax

var returnValue = allianceExistsBetween(playerA, playerB);

Parameters

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

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

 

  • No labels