Skip to content

Commit

Permalink
Merge pull request #25 from OverlordZorn/slingload-cargoOwner
Browse files Browse the repository at this point in the history
add Slingload CargoOwner Function
  • Loading branch information
OverlordZorn authored Sep 4, 2024
2 parents 06f41cd + 7f63577 commit e5c24e2
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 4 deletions.
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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/*
1 change: 1 addition & 0 deletions addons/others/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class CfgFunctions
file = "z\cvo_aux\addons\others\functions";
class executeUnit {};
class airlift_cargo {};
class slingload_cargoOwner {};
};
};
};
Expand Down
51 changes: 51 additions & 0 deletions addons/others/functions/fn_slingload_cargoOwner.sqf
Original file line number Diff line number Diff line change
@@ -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;
}];
};
*/

0 comments on commit e5c24e2

Please sign in to comment.