Advertisement
dapperstache

NUP_fnc_addFlagHoldAction

Jun 17th, 2024
447
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 1.72 KB | Gaming | 0 0
  1.  
  2. params[ "_flag" ];
  3.  
  4. _icon = "\a3\ui_f\data\igui\cfg\holdactions\holdaction_takeoff2_ca.paa";
  5. _duration = ["NUP_flagCapSpeed", 5] call BIS_fnc_getParamValue;
  6.  
  7. [
  8.     _flag,
  9.     "Capture Post",
  10.     _icon,
  11.     _icon,
  12.     "_target getVariable[ ""TER_flagSide"", sideUnknown ] != side _this",
  13.     "true",
  14.     //Start
  15.     {
  16.     },
  17.     //Progress
  18.     {
  19.         params[ "_flag", "", "", "", "_progress", "_maxProgress" ];
  20.  
  21.         _relProgress = _progress/_maxProgress;
  22.  
  23.         _progress = if ( _relProgress <= 0.5 ) then {
  24.             linearConversion[ 0, 0.5, _relProgress, 1, 0 ]
  25.         }else{
  26.             linearConversion[ 0.5, 1, _relProgress, 0, 1 ]
  27.         };
  28.  
  29.         _baseMarker = _flag getVariable "NUP_baseMarker";
  30.         [ _flag, _progress ] remoteExec [ "setFlagAnimationPhase", 0, format[ "capFlagPhase_%1", _baseMarker ] ];
  31.         if (_progress == 0) then {
  32.             _sideID = side player;
  33.             _fileFlag = ["flag_csat_co", "flag_nato_co", "flag_aaf_co", "flag_fd_purple_co", "flag_white_co"] select (_sideID call BIS_fnc_sideID);
  34.             _flag setFlagTexture format ["\a3\data_f\flags\%1.paa", _fileFlag];
  35.         };
  36.     },
  37.     //Completed
  38.     {
  39.         params[ "_flag", "_caller" ];
  40.  
  41.         [ _flag, side _caller ] remoteExec [ "NUP_fnc_captureFlag", 2 ];
  42.     },
  43.     //Interrupt
  44.     {
  45.         params[ "_flag", "_caller" ];
  46.  
  47.         _baseMarker = _flag getVariable "NUP_baseMarker";
  48.         [ _flag, 1 ] remoteExec [ "setFlagAnimationPhase", 0, format[ "capFlagPhase_%1", _baseMarker ] ];
  49.         _sideID = _flag getVariable "TER_flagSide";
  50.             _fileFlag = ["flag_csat_co", "flag_nato_co", "flag_aaf_co", "flag_fd_purple_co", "flag_white_co"] select (_sideID call BIS_fnc_sideID);
  51.             _flag setFlagTexture format ["\a3\data_f\flags\%1.paa", _fileFlag];
  52.     },
  53.     [],
  54.     _duration,
  55.     1.5,
  56.     false
  57. ] call BIS_fnc_holdActionAdd;
Tags: arma
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement