Versions Compared

Key

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

Get the current production limit for a specific droid type or the total number of droids a player can produce...

 

Syntax

Code Block
themeRDark
languagejavascript
linenumberstrue
var limit = getDroidLimit(player[, droidType]);

Parameters

ParameterTypeMandatoryNotesWarzone Version
player

Number

(tick)

Which player(s) should the droids be counted for?

Specify the player id for which the limit will be appliedThe id of the player who's droid limits you want to inspect.

3.1 RC2
droidTypeConstant(error)

If specified, the limit for a specific type of droid will be returned.

If not specified, defaults to DROID_ANY which returns the overall number of droids, irrespective of type, that the player can produce.

3.1 RC2

Return value

ValueTypeNotesWarzone Version
<limit>NumberIf parameters are valid, the function returns the limit that's been set for either the specific droid, or the maximum number of droids the player can produce.3.1 RC2
<error>ErrorAn error occurred, most likely the player did not exist or there was an issue with the droidType specified.3.1 RC2

Example

Code Block
themeRDark
languagejavascript
linenumberstrue
var limit = getDroidLimit(me); // how many droids can I produce in total?
 
var trucks = getDroidLimit(me, DROID_CONSTRUCT); // how many trucks can I have?
Div
classbox
Availability
Status
colourYellow
titleRC

Requires:

  • Warzone 3.1 RC2 or above
Div
classbox
Contents

Jump to:

Table of Contents
maxLevel5

Div
classbox

See also

Related articles:

  • setDroidLimit() – set droid limits for a player
  • Droids – quick reference to JS API features relating to droids
  • countDroid() – determine how many droids a player currently has
  • Droid object – lots of useful information on droids