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 5 Current »

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

 

Syntax

var limit = getDroidLimit(player[, droidType]);

Parameters

ParameterTypeMandatoryNotesWarzone Version
player

Number

(tick)

The 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

var limit = getDroidLimit(me); // how many droids can I produce in total?
 
var trucks = getDroidLimit(me, DROID_CONSTRUCT); // how many trucks can I have?
Availability 3.1 RC2+

Requires:

  • Warzone 3.1 RC2 or above
Contents

Jump to:

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

 

  • No labels