Overview
Returns an array of all enemy structures of a given type, optionally filtered to visibility of lookingPlayer.Availability
Warzone 3.1 Beta 1 and above.
Requires getEnemyPlayerIDs()
Code
function enumEnemyStruct(structure,viewer) { var list = []; var enemies = getEnemyPlayerIDs(); enemies.forEach(function(enemy) { if (!!viewer) { list = list.concat(enumStruct(enemy,structure,viewer)); } else { list = list.concat(enumStruct(enemy,structure)); } }); return list; }
Example
// get a list of enemy oil derricks var enemyDerricks = enumEnemyStruct(RESOURCE_EXTRACTOR);
See also
- enumStruct() – get a list of structure objects
- getEnemyPlayerIDs() – returns an array of enemy (including scavs) player IDs
- .stattype – structure type constants
- Structure object – defines a structure object