daily pastebin goal
44%
SHARE
TWEET

global array for units

Faguss Apr 2nd, 2017 (edited) 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if (Format ["%1",FUNCTION_ASSIGN_ID] == "scalar bool array string 0xfcffffef") then
  2. {
  3.     UNITS_LIST = [];
  4.     UNIT_ANIMATION_LIST = [];
  5.  
  6.     FUNCTION_ASSIGN_ID =
  7.     {
  8.         if (!(_this in UNITS_LIST)) then
  9.         {
  10.             UNITS_LIST set [count UNITS_LIST, _this];
  11.             UNIT_ANIMATION_LIST set [count UNIT_ANIMATION_LIST, ""];
  12.         }
  13.     };
  14.  
  15.     FUNCTION_SETANIM =
  16.     {
  17.         private ["_id"];
  18.         _id = UNITS_LIST find (_this select 0);
  19.         if (_id >= 0) then {UNIT_ANIMATION_LIST set [_id, _this select 1]};
  20.     };
  21.  
  22.     FUNCTION_GETANIM =
  23.     {
  24.         private ["_id"];
  25.         _id = UNITS_LIST find (_this select 0);
  26.         if (_id >= 0) then {UNIT_ANIMATION_LIST select _id} else {""}
  27.     };
  28. };
  29.  
  30. true
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