fn_deleteAction.sqf 924 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. _type = (typeName (_this select 0));
  2. _id = 0;
  3. _obj = objNull;
  4. _local = false;
  5. switch (_type) do
  6. {
  7. case "SCALAR":
  8. {
  9. _id = _this select 0;
  10. _obj = _this select 1;
  11. _local = if ((count _this) > 2) then { _this select 2 } else { false };
  12. };
  13. case "ARRAY":
  14. {
  15. _id = (_this select 0) select 2;
  16. _obj = (_this select 0) select 0;
  17. _local = if ((count _this) > 1) then { _this select 1 } else { false };
  18. };
  19. };
  20. if (isServer) then { _local = false; };
  21. if (!(isServer && _local)) then { _obj removeAction _id; };
  22. if (!_local) then
  23. {
  24. [[_id, _obj, true], "AW_fnc_deleteAction", true] call BIS_fnc_MP;
  25. _index = 0;
  26. {
  27. _element = _x select 0;
  28. _idFound = _element select 0;
  29. _objFound = _element select 1;
  30. if (_obj == _objFound && _id == _idFound) exitWith
  31. {
  32. JIPactions = [JIPactions, _index] call BIS_fnc_removeIndex;
  33. };
  34. _index = _index + 1;
  35. } forEach JIPactions;
  36. publicVariable "JIPactions";
  37. };