Advertisement
Guest User

holdAction

a guest
Jun 20th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. /* // DAC camp event string
  2. "zeu_dac_camps append [_x]; publicVariable 'zeu_dac_camps'; ['zeu_add_hold_action', [_x]] call CBA_fnc_globalEventJIP;"
  3. */
  4.  
  5. if (isNil "zeu_dac_camps") then {zeu_dac_camps = []};
  6.  
  7. //
  8. zeu_fnc_add_hold_action = {
  9. params ["_target"];
  10. [
  11. _target, // Object the action is attached to
  12. "Gather Intel", // Title of the action
  13. "\a3\ui_f\data\IGUI\Cfg\simpleTasks\types\documents_ca.paa", // Idle icon shown on screen
  14. "\a3\ui_f\data\IGUI\Cfg\simpleTasks\types\documents_ca.paa", // Progress icon shown on screen
  15. "(_this distance _target < 3) && !(_target getVariable ['zeu_intel_gathered', false])", // Condition for the action to be shown
  16. "true", // Condition for the action to progress
  17. {}, // Code executed when action starts
  18. {}, // Code executed on every progress tick
  19. {// Code executed on completion
  20. params ["_target", "_caller", "_actionId", "_arguments"];
  21. ["zeu_show_intel", [_target]] call CBA_fnc_serverEvent;
  22. },
  23. {}, // Code executed on interrupted
  24. [], // Arguments passed to the scripts as _this select 3
  25. 5, // Action duration [s]
  26. 0, // Priority
  27. true, // Remove on completion
  28. false // Show in unconscious state
  29. ] call BIS_fnc_holdActionAdd;
  30. };
  31.  
  32. //
  33. zeu_fnc_show_intel = {
  34. params ["_target"];
  35. if !(_target getVariable ['zeu_intel_gathered', false]) then {
  36. _target setVariable ['zeu_intel_gathered', true, true];
  37.  
  38. private _num = 500;
  39. private _camp = selectRandom (zeu_dac_camps select {alive _x && _x != _target});
  40. if (isNil "_camp") exitWith {systemChat "no camp found"};
  41. private _helper = 'Sign_Sphere10cm_F' createVehicleLocal (getPos _camp);
  42. _helper setDir (random 360);
  43. private _pos = _helper modelToWorld [0,_num,0];
  44. private _name = format['zeu_dac_mkr_%1', round time];
  45. deleteVehicle _helper;
  46.  
  47. _markerstr = createMarker [_name, _pos];
  48. _markerstr setMarkerShape 'ELLIPSE';
  49. _markerstr setMarkerBrush 'Border';
  50. _markerstr setMarkerColor 'colorYellow';
  51. _markerstr setMarkerSize [_num, _num];
  52. };
  53. };
  54.  
  55. // create CBA Events
  56. ["zeu_show_intel", zeu_fnc_show_intel] call CBA_fnc_addEventHandler;
  57. ["zeu_add_hold_action", zeu_fnc_add_hold_action] call CBA_fnc_addEventHandler;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement