getDroidLimit()

(info) Other great resources: Official JS API docs, Scripting Forum

getDroidLimit()

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

Parameter

Type

Mandatory

Notes

Warzone Version

Parameter

Type

Mandatory

Notes

Warzone Version

player

Number

The id of the player who's droid limits you want to inspect.

3.1 RC2

droidType

Constant

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

Value

Type

Notes

Warzone Version

Value

Type

Notes

Warzone Version

<limit>

Number

If 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>

Error

An 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?