diff --git a/.gitignore b/.gitignore index bf3f34e..53cc346 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,7 @@ *.pbo -.hemttout +/.hemttout/* hemtt hemtt.exe *.biprivatekey .vscode -releases/cvo_aux-latest.zip -releases/cvo_aux-0.1.1-9515.zip -/releases +/releases/* diff --git a/addons/others/config.cpp b/addons/others/config.cpp index baa7df6..c3bd1b1 100644 --- a/addons/others/config.cpp +++ b/addons/others/config.cpp @@ -40,6 +40,7 @@ class CfgFunctions file = "z\cvo_aux\addons\others\functions"; class executeUnit {}; class airlift_cargo {}; + class slingload_cargoOwner {}; }; }; }; diff --git a/addons/others/functions/fn_slingload_cargoOwner.sqf b/addons/others/functions/fn_slingload_cargoOwner.sqf new file mode 100644 index 0000000..0a1eda6 --- /dev/null +++ b/addons/others/functions/fn_slingload_cargoOwner.sqf @@ -0,0 +1,51 @@ +/* +* Author: Zorn +* Adds eventhandler to the helicopter to change the owner of sling loaded cargo. +* To be used in the helicopters init attribute field. +* +* Arguments: +* +* Return Value: +* None +* +* Example: +* [this] call CVO_Common_fnc_slingload_cargoOwner; +* Public: Yes +*/ + +params [ + ["_heli", objNull, [objNull]] +]; + +if (isServer) then { + _heli addEventHandler ["RopeAttach", { + params ["_heli", "_rope", "_cargo"]; + _cargo setOwner (owner driver _heli); + }]; + + _heli addEventHandler ["RopeBreak", { + params ["_heli", "_rope", "_cargo"]; + _cargo setOwner 2; + }]; +}; + + + + + +/* + +if (isServer) then { + this addEventHandler ["RopeAttach", { + params ["_heli", "_rope", "_cargo"]; + _cargo setOwner (owner driver _heli); + }]; + + this addEventHandler ["RopeBreak", { + params ["_heli", "_rope", "_cargo"]; + _cargo setOwner 2; + }]; +}; + + +*/ \ No newline at end of file