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 4 Next »

Overview

Determine whether two players are allies with each other.

Syntax

var returnValue = allianceExistsBetween(playerA, playerB);

Parameters

ParameterTypeMandatoryDescription
playerANumber(tick)The ID of the first player
playerBNumber(tick)The ID of the second player

Return value

ValueTypeDescription
trueBooleanIndicates that the two players are allied with each other
falseBooleanThe two players are enemies of each other

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