Other great resources: Official JS API docs, Scripting Forum
countStruct()
Count the number of structures of a given type...
Syntax
var numStructs = countStruct(structureID[, player]);Parameters
Parameter | Type | Mandatory | Notes | Game Version |
|---|---|---|---|---|
structureID | String | The ID of the structure type to count. | 3.1.0 | |
player | Number Constant | Which player(s) should the structures be counted for? You can specify a specific player ID, or one of the following constants: Default: me | 3.1.0 |
Return value
Value | Type | Notes | Warzone Version |
|---|---|---|---|
<number> | Number | The number of structures of the specified type for the specified player(s). | 3.1.0 |
<error> | Error | An error occurred, most likely you used an unsupported structureID or the specified player does not exist. | 3.1.0 |
Notes
Does not count off-world structures (use enumStructOffWorld() to list those).
Example