diff --git a/SQF/dayz_code/Configs/CfgWeapons/Item/ItemToolbox.hpp b/SQF/dayz_code/Configs/CfgWeapons/Item/ItemToolbox.hpp new file mode 100644 index 000000000..8247833f2 --- /dev/null +++ b/SQF/dayz_code/Configs/CfgWeapons/Item/ItemToolbox.hpp @@ -0,0 +1,16 @@ +class ItemToolbox ItemCore +{ + scope = 2; + displayName = $STR_EQUIP_NAME_2; + model = dayz_equipmodelstoolbox.p3d; + picture = dayz_equiptexturesequip_toolbox_ca.paa; + descriptionShort = $STR_EQUIP_DESC_2; + class ItemActions + { + class RemoveNet + { + text="Remove Camo Net"; + script="spawn player_removeNet;"; + }; + }; +}; \ No newline at end of file diff --git a/SQF/dayz_code/compile/object_removeNet.sqf b/SQF/dayz_code/compile/object_removeNet.sqf new file mode 100644 index 000000000..b4c159d9e --- /dev/null +++ b/SQF/dayz_code/compile/object_removeNet.sqf @@ -0,0 +1,13 @@ +private ["_nearNets","_nearNet"]; + +_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1; +_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder); + +_nearNets = nearestObjects [player, ["DesertLargeCamoNet", "ForestCamoNet_DZ","DesertLargeCamoNet_DZ", "ForestLargeCamoNet_DZ"], 10]; +_nearNet = _nearNets select 0; + + if (!isNull _nearNet and _canDo) then { + [0,1,2,_nearNet] spawn player_removeObject; + } else { + cutText ["No camo nets found nearby.", "PLAIN DOWN"]; + }; \ No newline at end of file diff --git a/SQF/dayz_code/init/compiles.sqf b/SQF/dayz_code/init/compiles.sqf index 5db973e87..35938ce10 100644 --- a/SQF/dayz_code/init/compiles.sqf +++ b/SQF/dayz_code/init/compiles.sqf @@ -30,6 +30,9 @@ if (!isDedicated) then { player_packVault = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_packVault.sqf"; player_unlockVault = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_unlockVault.sqf"; + player_removeObject = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\remove.sqf"; + player_removeNet = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_removeNet.sqf"; + player_unlockDoor = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_unlockDoor.sqf"; player_changeCombo = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_changeCombo.sqf";