Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 1.90 KB | None | 0 0
  1. private _holdActionID =  0;
  2. private _holdActionIDs = [];
  3.  
  4. {
  5.     private _textInfo = getText (_x >> "text");
  6.     private _actioniconInfo = getText (_x >> "icon");
  7.     private _idleiconInfo = getText (_x >> "icon");
  8.     private _modelInfo = getArray (_x >> "models");
  9.     private _objectsList = missionNamespace getVariable ["ExileClientSavengedObjects", []];
  10.     private _playerCursorTarget = [];
  11.     private _playerCursorTargetParams = [];
  12.     private _parent = [];
  13.     _playerCursorTarget = lineIntersectsSurfaces [
  14.       AGLToASL positionCameraToWorld [0,0,0],
  15.       AGLToASL positionCameraToWorld [0,0,5],
  16.        player,
  17.        objNull,
  18.        true,
  19.        1,
  20.        "GEOM",
  21.        "NONE"
  22.     ];
  23.     _playerCursorTargetParams = (_playerCursorTarget select 0);
  24.     _parent = (_playerCursorTargetParams select 3);
  25.     _modelInfoTarget = str (getModelInfo _parent select 0);
  26.     _condition = format ["((%1 in %2) && !(%1 in (missionNamespace getVariable ['ExileClientSavengedObjects', []])) && (player getVariable ['CanScavenge', true]) && (vehicle player == player))", _modelInfoTarget, _modelInfo];
  27.     private _configClassName = configName _x;
  28.  
  29.     _holdActionID =
  30.     [
  31.         player, _textInfo,  _actioniconInfo, _idleiconInfo, _condition, "_caller distance _target < 5", {},
  32.         {
  33.             private _progressTick = _this select 4;
  34.             if (_progressTick % 2 == 0) exitwith {};
  35.             playsound3d [((getarray (configfile >> "CfgSounds" >> "Orange_Action_Wheel" >> "sound")) param [0,""]) + ".wss",player,false,getposasl player,1,0.9 + 0.2 * _progressTick / 24];
  36.         },
  37.         {
  38.             _configClassName = (_this select 3) select 0;
  39.             [_configClassName] call ExileExpansionClient_system_scavenge_action_conditionEvents;
  40.         },
  41.         {},
  42.         [_configClassName], 0.5, 0, false
  43.     ] call ExileExpansionClient_gui_holdActionAdd;
  44.  
  45.     _holdActionIDs pushBack _holdActionID;
  46. } forEach ("true" configClasses (missionConfigFile >> "CfgExileScavenge"));
  47.  
  48. player setVariable ["ExileScavangeActionIDs", _holdActionIDs];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement