fnc_fired_deployable_personalShieldDeployServer.sqf 982 B

1234567891011121314151617181920212223242526272829
  1. params["_unit", "_ammo"];
  2. // TODO: Merge with fired_deployable_deployServer
  3. private _config = configFile >> "CfgAmmo" >> _ammo;
  4. if!(isClass _config) exitWith {
  5. diag_log format["[RD501][Fired Deployable][Personal Shield] Unable to find class '%1' in CfgAmmo", _ammo];
  6. };
  7. private _isValid = getNumber (_config >> "rd501_fired_deployable") == 1;
  8. private _deployable = getText (_config >> "rd501_fired_deployable_object");
  9. private _timeToLive = getNumber (_config >> "rd501_fired_deployable_timeToLive");
  10. private _offset = getArray (_config >> "rd501_fired_deployable_personal_offset");
  11. private _bone = getText (_config >> "rd501_fired_deployable_personal_bone");
  12. private _deployed = createVehicle [_deployable, [0, 0, 0], [], 0, "CAN_COLLIDE"];
  13. _deployed attachTo [_unit, _offset, _bone, false];
  14. if(_timeToLive > 0) then {
  15. [
  16. {
  17. params["_deployable"];
  18. detach _deployable;
  19. deleteVehicle _deployable;
  20. },
  21. [_deployed],
  22. _timeToLive
  23. ] call CBA_fnc_waitAndExecute;
  24. };