Versions Compared
compared with
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 | ||||||
---|---|---|---|---|---|---|
| ||||||
var limit = getDroidLimit(player[, droidType]); |
Parameters
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 |
---|---|---|---|
<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
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
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 | |||||||
---|---|---|---|---|---|---|---|
| |||||||
Availability
Requires:
|
Div | ||||
---|---|---|---|---|
| ||||
ContentsJump to:
|
Div | ||
---|---|---|
| ||
See alsoRelated articles:
|