stun.sqf 587 B

12345678910111213141516
  1. params ["_unit", "_source", "_instigator"];
  2. {
  3. private _mag = currentMagazine _source;
  4. private _ammo = (configFile >> "CfgMagazines" >> _mag >> "ammo") call BIS_fnc_getCfgData;
  5. private _stunDuration = (configFile >> "CfgAmmo" >> _ammo >> "RD501_stunDuration") call BIS_fnc_getCfgData;
  6. if (_stunDuration > 0.0) then
  7. {
  8. ["ace_captives_setSurrendered" ,[_unit, true]] call CBA_fnc_globalEvent;
  9. [{
  10. ["ace_captives_setSurrendered", [_this select 0, false]] call CBA_fnc_globalEvent;
  11. }, [_unit], _stunDuration] call CBA_fnc_waitAndExecute;
  12. };
  13. } remoteExec ['call', _instigator];