Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Overview

Excerpt

Determine whether two players are allies with each other...

 

Syntax

Code Block
theme

...

RDark
languagejavascript
linenumberstrue
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

Code Block
theme

...

RDark
languagejavascript
titleShould I attack the other player?
linenumberstrue
if (!allianceExistsBetween(me, theOtherPlayer)) attackTheOtherPlayer();
Div
class

...

box
Availability
Status
colourGreen
title3.1 b1+

Requires:

  • Warzone 3.1 Beta 1 or above.
Div
classbox
Contents

Jump to:

Table of Contents
maxLevel5

Div
classbox

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