Example Code: Remove NVGs From Enemies: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\[\[SQS[ _]syntax" to "[[SQS Syntax") |
Lou Montana (talk | contribs) m (Text replacement - "\[\[SQF[ _]syntax" to "[[SQF Syntax") |
||
Line 30: | Line 30: | ||
{{ArgTitle|{{arma1}} / {{ofpr}}|2|{{GVI|arma1|1.00}} {{GVI|ofpr|1.85}}}} | {{ArgTitle|{{arma1}} / {{ofpr}}|2|{{GVI|arma1|1.00}} {{GVI|ofpr|1.85}}}} | ||
{{Feature | Informative | | {{Feature | Informative | | ||
* [[SQF | * [[SQF Syntax]] has been introduced in {{GVI|ofpr|1.85}} | ||
}} | }} | ||
[[private]] "_enemySide"; {{cc|private definition of the _enemySide variable}} | [[private]] "_enemySide"; {{cc|private definition of the _enemySide variable}} |
Revision as of 22:56, 24 March 2021
2
private _enemySide = opfor; // definition of the enemy side private _enemies = allUnits select { side _x == _enemySide; }; // selection of all enemy units from allUnits { _x unlinkItem hmd _x; // removal of each unit's hmd } forEach _enemies; // code is to be executed for each enemy
2
private "_enemySide"; // private definition of the _enemySide variable _enemySide = east; // value attribution to _enemySide { if (side _x == _enemySide) then // if the unit is on the _enemySide, process the next step { _x removeWeapon "NVGoggles"; // removal of the enemy unit's NVG } } forEach allUnits; // going through all units
private "_enemySide"; // private definition of the _enemySide variable _enemySide = east; // value attribution to _enemySide { if (side _x == _enemySide) then // if the unit is on the _enemySide, process the next step { _x removeWeapon "NVGoggles"; // removal of the enemy unit's NVG } } forEach _unitsArray; // going through provided units - allUnits has been introduced in Arma 2
2
// remove its NVG for each provided enemy units "_x removeWeapon ""NVGoggles""" forEach _enemyUnitsArray