fn_ragdollUnit.sqf 527 B

123456789101112131415161718192021222324252627
  1. /*
  2. Author: Killzone_Kid
  3. Description:
  4. Forces the unit into ragdoll. Should be executed where unit is local.
  5. Parameters:
  6. 0: OBJECT - Unit being forced into ragdoll.
  7. Returns:
  8. NONE
  9. */
  10. params ["_unit"];
  11. if (vehicle _unit != _unit) exitWith {};
  12. private "_rag";
  13. _rag = "Land_Can_V3_F" createVehicleLocal [0,0,0];
  14. _rag setMass 1e10;
  15. _rag attachTo [_unit, [0,0,0], "Spine3"];
  16. _rag setVelocity [0,0,6];
  17. _unit allowDamage false;
  18. detach _rag;
  19. [_rag, _unit] spawn {
  20. deleteVehicle (_this#0);
  21. (_this#1) allowDamage true;
  22. };