Advertisement
Faguss

global array for units

Apr 2nd, 2017
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement