SHARE
TWEET

Hostage

Pwner-Actual Mar 19th, 2019 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // =======================================================================================
  2. // =======================================  SETUP  =======================================
  3. // =======================================================================================
  4. // INSTRUCTIONS
  5. // =======================================================================================
  6. /*
  7.     USAGE   :   Server only.
  8.    
  9.     PURPOSE :   Make units become hostages.
  10.                 Units will lose weapons and gear, become captive, and have their hands bound behing their back (animation).
  11.                 If the 'UAF Hostage' action was added to players, the latter can free friendly hostages.
  12.                
  13.     EXAMPLE :   nul = [[hostage_1, hostage_2]] execVM "UAF\hostage.sqf";
  14.    
  15.     FORMAT  :   nul = [[A]] execVM "UAF\Hostage.sqf";
  16.     A =         Array of unit names that will become hostages
  17. */
  18. // =======================================================================================
  19. // SERVER ONLY
  20. // =======================================================================================
  21. if (!isServer) exitWith {};
  22. // =======================================================================================
  23. // DEFINE & DECLARE VARIABLES
  24. // =======================================================================================
  25. //      VARS & VALUES THRU ARGUMENTS
  26. // =======================================================================================
  27. private _hostages = _this select 0;
  28. // =======================================================================================
  29. // ====================================  SCRIPT  =========================================
  30. // =======================================================================================
  31. _aliveHos = _hostages select {alive _x};    // apply to units that are still alive
  32. _aliveHos apply {
  33.     _x disableAI "AUTOCOMBAT";
  34.     _x disableAI "AUTOTARGET";
  35.     _x disableAI "TARGET";
  36.     _x disableAI "MOVE";
  37.     _x disableAI "FSM";
  38.     _x setCaptive true;
  39.     removeAllWeapons _x;
  40.     removeAllItemsWithMagazines _x;
  41.     removeAllItems _x;
  42.     removeBackpackGlobal _x;
  43.     [_x,"acts_executionvictim_loop"] remoteExec ["switchMove",[0,-2] select isDedicated];
  44. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top