allDeadMen: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<sqf>([^ ]+) <\/sqf>" to "<sqf>$1</sqf>")
(formatted note)
(One intermediate revision by one other user not shown)
Line 14: Line 14:
|x1= <sqf>{ deleteVehicle _x } forEach allDeadMen;</sqf>
|x1= <sqf>{ deleteVehicle _x } forEach allDeadMen;</sqf>


|seealso= [[allDead]] [[allUnits]] [[allGroups]] [[playableUnits]] [[switchableUnits]] [[units]] [[vehicles]] [[allCurators]]
|seealso= [[allDead]] [[allUnits]] [[allGroups]] [[playableUnits]] [[switchableUnits]] [[units]] [[vehicles]] [[allCurators]] [[getCorpse]]
}}
}}


Line 25: Line 25:


As dead men are civilian side, don't try to count them with {side _x isEqualTo EAST} count allDeadMen; result will always be 0.<br>
As dead men are civilian side, don't try to count them with {side _x isEqualTo EAST} count allDeadMen; result will always be 0.<br>
Use the configfile "side" instead:<br>
Use the configfile "side" instead:
0 = [] spawn {while {true} do {sleep 0.1;<br> _westScore = {getNumber (configfile >> "CfgVehicles" >> typeOf _x >> "side") == 0} count allDeadMen;<br> hintSilent format ["East killed: %1",_westScore]};};<br>
<sqf>[] spawn  
 
{
</dl>
  while {true} do  
  {
    sleep 0.1;
    _westScore =  
    {
      getNumber (configfile >> "CfgVehicles" >> typeOf _x >> "side") == 0
    } count allDeadMen;
    hintSilent format ["East killed: %1",_westScore];
  };
};</sqf>

Revision as of 20:07, 2 September 2022

Hover & click on the images for description

Description

Description:
Return a list of dead units including agents. Dead unit might be inside vehicle.
Groups:
Object Detection

Syntax

Syntax:
allDeadMen
Return Value:
Array

Examples

Example 1:
{ deleteVehicle _x } forEach allDeadMen;

Additional Information

See also:
allDead allUnits allGroups playableUnits switchableUnits units vehicles allCurators getCorpse

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Posted on 17 Oct, 2009
Pierre MGI
As dead men are civilian side, don't try to count them with {side _x isEqualTo EAST} count allDeadMen; result will always be 0.
Use the configfile "side" instead:
[] spawn { while {true} do { sleep 0.1; _westScore = { getNumber (configfile >> "CfgVehicles" >> typeOf _x >> "side") == 0 } count allDeadMen; hintSilent format ["East killed: %1",_westScore]; }; };