Skip to content

Commit

Permalink
Hostage PreInit, Ace Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
PiZZAD0X committed Aug 31, 2019
1 parent a5d3881 commit c15cd2a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
9 changes: 9 additions & 0 deletions addons/hostage/CfgEventHandlers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,14 @@ class Extended_PreStart_EventHandlers {
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));
clientinit = QUOTE(call COMPILE_FILE(XEH_preClientInit));
};
};

class Extended_InitPost_EventHandlers {
class CAManBase {
class ADDON {
init = QUOTE(call FUNC(InitPost));
};
};
};
10 changes: 4 additions & 6 deletions addons/hostage/XEH_preClientInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@
params ["_unit"];
private _condition = {
params ["_target", "_player"];
LOG_2("_statement %1, %2",_target,_player);
(!(GETVAR((_this select 0),IsRescued,false))
&& !(GETVAR((_this select 0),IsUntied,false))
&& {(alive (_this select 0))})
(!(GETVAR(_target,IsRescued,false))
&& {!(GETVAR(_target,IsUntied,false))}
&& {(alive _target)})
};
private _statement = {
params ["_target", "_player"];
LOG_2("_statement %1, %2",_target,_player);
[_target,_player] call FUNC(Rescue);
};
private _rescueaction = ["RescueHostage", "Rescue Hostage","",_statement,_condition] call ace_interact_menu_fnc_createAction;
private _rescueaction = ["RescueHostage", "Untie Hostage","",_statement,_condition] call ace_interact_menu_fnc_createAction;
[_unit, 0, ["ACE_MainActions"], _rescueaction] call ace_interact_menu_fnc_addActionToObject;
}] call CBA_fnc_addEventHandler;

0 comments on commit c15cd2a

Please sign in to comment.