From 01cdb3272d2fb43bdb8d5e44974cfdb2386ce82e Mon Sep 17 00:00:00 2001 From: vbawol Date: Wed, 16 Dec 2015 15:19:14 -0600 Subject: [PATCH] 0.3.6.022 --- Server_Install_Pack/sc/battleye/scripts.txt | 2 +- .../compile/traders/EPOCH_startNpcTrade.sqf | 51 +++++++++---------- 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/Server_Install_Pack/sc/battleye/scripts.txt b/Server_Install_Pack/sc/battleye/scripts.txt index 42041867..b15ffe78 100644 --- a/Server_Install_Pack/sc/battleye/scripts.txt +++ b/Server_Install_Pack/sc/battleye/scripts.txt @@ -25,7 +25,7 @@ 7 addMagazine !"addMagazineCargo" !="player addMagazine _craftItem;" !="player addMagazine \"jerrycanE_epoch\";" !="player addMagazine \"emptyjar_epoch\";" !="player addMagazine \"jerrycan_epoch\";" !="player addMagazine \"Hatchet_swing\";" !="player addMagazine [(_x select 0),(_x select 1)]" !="player addMagazine _x;" !="if !(player canAdd (_x select 0)) exitWith {};\nplayer addMagazine[_x select 0, _x select 1];" 7 addMagazineCargo !"_dogHolder addMagazineCargo [\"RabbitCarcass_EPOCH\", 1]" !"_dogHolder addMagazineCargo [\"Pelt_EPOCH\", 1]" !"_dogHolder addMagazineCargo [\"Venom_EPOCH\", 1]" !"_dogHolder addMagazineCargo [\"SnakeCarcass_EPOCH\", 1]" !"_dogHolder addMagazineCargo [\"ChickenCarcass_EPOCH\", 1]" !="_acceptHolder addMagazineCargo [_wAmmo, 1] ;" 7 addItem !="player addItem _item;" !="player addItem _craftItem;" !="player addItem _x;" !="_plyr addItemToVest _missionItem;" !="axeVIP addItemToVest _item;" !="_plyr addItemToVest _missionItem;" !="EPOCH_fnc_addItemOverflow" -7 addBackPack !="if (backpack player == "") then {\nplayer addbackpack _x;\n}\nelse {\n_x createvehicle getpos player;\n};" +7 addBackPack !="if (backpack player == "") then {\nplayer addbackpack _x;\n}\nelse {" 7 addMissionEventHandler !="addMissionEventHandler ['Draw3D',_var + \"call Epoch_gui3DCooldownEH;\"];" !="addMissionEventHandler ['Draw3D',_var + \"call epoch_gui3dModelPosEH;\"];" !="addMissionEventHandler ['Draw3D',_var + \"call epoch_gui3dWorldPosEH;\"];" !="addMissionEventHandler [\n"ended",\n{\n\nBIS_fnc_missionHandlers_end = _this;" 7 removeMissionEventHandler !="removeMissionEventHandler [\"Draw3D\", _id];" 7 removeAllWeapons !="removeAllWeapons axeGeneral;" diff --git a/Sources/epoch_code/compile/traders/EPOCH_startNpcTrade.sqf b/Sources/epoch_code/compile/traders/EPOCH_startNpcTrade.sqf index e9cf10f4..a347dfb4 100644 --- a/Sources/epoch_code/compile/traders/EPOCH_startNpcTrade.sqf +++ b/Sources/epoch_code/compile/traders/EPOCH_startNpcTrade.sqf @@ -174,39 +174,38 @@ if (!isNull _this) then { else { _x call EPOCH_fnc_addItemOverflow; }; - } - else { - _backpack = ["backpack", _x] call BIS_fnc_inString; - _Assaultpack = ["Assaultpack", _x] call BIS_fnc_inString; - _Assault_Diver = ["Assault_Diver", _x] call BIS_fnc_inString; - _TacticalPack = ["TacticalPack", _x] call BIS_fnc_inString; - _FieldPack = ["FieldPack", _x] call BIS_fnc_inString; - _Carryall = ["Carryall", _x] call BIS_fnc_inString; - _OutdoorPack = ["OutdoorPack", _x] call BIS_fnc_inString; - _Bergen = ["Bergen", _x] call BIS_fnc_inString; - _bag = ["bag", _x] call BIS_fnc_inString; - _parachute = ["Parachute", _x] call BIS_fnc_inString; - if (_backpack || _Assaultpack || _Assault_Diver || _TacticalPack || _FieldPack || _Carryall || _OutdoorPack || _Bergen || _bag || _parachute) then { + } else { + // + if (_x isKindOf "Bag_Base") then { + // add to players back if (backpack player == "") then { player addbackpack _x; - } - else { - _x createvehicle getpos player; + } else { + // add to the ground + _wH = objNull; + _nearByHolder = nearestObjects [position player,["groundWeaponHolder"],3]; + if (_nearByHolder isEqualTo []) then { + _wHPos = player modelToWorld [0,1,0]; + if (surfaceIsWater _wHPos) then { + _wHPos = ASLToATL _wHPos; + }; + _wH = createVehicle ["groundWeaponHolder",_wHPos, [], 0, "CAN_COLLIDE"]; + } else { + _wH = _nearByHolder select 0; + }; + _wh addBackpackCargoGlobal [_x,1]; + }; + } else { + if ([_x, "CfgMagazines"] call EPOCH_fnc_isAny) then { + _errorMsg = _errorMsg + format["%1, ", getText(configfile >> "CfgMagazines" >> (_x) >> "displayName")]; + _x call EPOCH_fnc_addItemOverflow; + } else { + _errorMsg = _errorMsg + format["%1, ", getText(configfile >> "CfgVehicles" >> (_x) >> "displayName")]; }; - } - else { - if ([_x, "CfgMagazines"] call EPOCH_fnc_isAny) then { - _errorMsg = _errorMsg + format["%1, ", getText(configfile >> "CfgMagazines" >> (_x) >> "displayName")]; - _x call EPOCH_fnc_addItemOverflow; - } - else { - _errorMsg = _errorMsg + format["%1, ", getText(configfile >> "CfgVehicles" >> (_x) >> "displayName")]; }; }; - }; } forEach(_this select 1); - _dt = [format["%1", _errorMsg], 0, 0.4, 5, 2, 0, 2] spawn bis_fnc_dynamictext; } else {