mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
Prevent MeleeMagazines being counted by BIS_fnc_inv
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
private ["_selection","_return","_toBuyWeaps","_toBuyMags","_toBuyBags","_toolsToBuy","_sidearmToBuy","_primaryToBuy","_currentPrimarys"
|
||||
,"_currentSecondarys","_currentSec","_currentPrim","_currentTool","_p","_s","_b","_check0","_check1","_check2","_check3","_check4","_mags","_weaps","_bags"
|
||||
,"_normalBags","_normalMags","_normalWeaps","_allowedMags","_allowedPrimary","_allowedTools","_allowedSidearm","_allowedWeapons","_allowedBackpacks"
|
||||
,"_totalSpace","_totalNewSpace","_counter","_parentClasses","_alreadyInBackpack","_kinds","_kinds2","_kinds3","_ammmounts","_ammmounts2","_ammmounts3"
|
||||
,"_totalSpace","_totalNewSpace","_counter","_parentClasses","_alreadyInBackpack","_kinds","_kinds2","_kinds3","_ammmounts","_ammmounts2","_ammmounts3",
|
||||
"_actualMags"
|
||||
];
|
||||
_selection = Z_SellingFrom;
|
||||
_return = false;
|
||||
@@ -19,7 +20,8 @@ if (_vehiclesToBuy > 0) then {
|
||||
};
|
||||
|
||||
if(_selection == 2) then{ //gear
|
||||
_allowedMags = 20 - count(magazines player);
|
||||
_actualMags = {!(_x in MeleeMagazines)} count (magazines player);
|
||||
_allowedMags = 20 - _actualMags;
|
||||
|
||||
_currentPrimarys = 0;
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
private["_selection","_returnArray","_allowedMags","_allowedWeapons","_allowedBackpacks","_allowedTools","_allowedPrimary","_allowedSidearm","_formattedText","_pic"
|
||||
,"_backpack","_backpackAmount","_vehicleWeapons","_vehicleMagazines","_vehicleBackpacks","_tempWeaponsArray","_tempBackpackArray","_tempMagazinesArray"];
|
||||
,"_backpack","_backpackAmount","_vehicleWeapons","_vehicleMagazines","_vehicleBackpacks","_tempWeaponsArray","_tempBackpackArray","_tempMagazinesArray","_actualMags"];
|
||||
#include "defines.sqf";
|
||||
|
||||
_selection = _this select 0;
|
||||
_returnArray = [0,0,0];
|
||||
if(_selection == 2) then{ //gear
|
||||
_allowedMags = 20 - count(magazines player);
|
||||
_actualMags = {!(_x in MeleeMagazines)} count (magazines player);
|
||||
_allowedMags = 20 - _actualMags;
|
||||
_allowedWeapons = 14 - count(weapons player);
|
||||
|
||||
_pic = getText (configFile >> 'CfgVehicles' >> (typeOf player) >> 'picture');
|
||||
|
||||
@@ -21,7 +21,7 @@ if (!isNil '_pic' && _pic == "") then {
|
||||
};
|
||||
|
||||
_formattedText = format [
|
||||
"<t size='1' align='center' color='#ffffff'> %2 </t>"
|
||||
"<t size='1' align='center' color='#ffffff'>%1 %2</t>"
|
||||
, _pic, localize "STR_UI_GEAR"
|
||||
];
|
||||
|
||||
|
||||
@@ -51,6 +51,8 @@ _hasInput = true;
|
||||
} forEach (_input + _required);
|
||||
|
||||
if (_hasInput) then {
|
||||
//Remove melee magazines (BIS_fnc_invAdd and BIS_fnc_invSlotsEmpty fix)
|
||||
{player removeMagazines _x} count MeleeMagazines;
|
||||
_freeSlots = [player] call BIS_fnc_invSlotsEmpty;
|
||||
{
|
||||
_item = _x select 0;
|
||||
|
||||
@@ -84,6 +84,8 @@ if ((count _upgrade) > 0) then {
|
||||
_abortInvAdd = false;
|
||||
_i = 0;
|
||||
_addedItems = [];
|
||||
//Remove melee magazines (BIS_fnc_invAdd fix)
|
||||
{player removeMagazines _x} count MeleeMagazines;
|
||||
|
||||
{
|
||||
_itemOut = _x select 0;
|
||||
|
||||
@@ -87,6 +87,8 @@ if(!r_drag_sqf and !r_player_unconscious and !_onLadder) then {
|
||||
} forEach (_input);
|
||||
|
||||
if (_hasInput) then {
|
||||
//Remove melee magazines (BIS_fnc_invAdd and BIS_fnc_invSlotsEmpty fix)
|
||||
{player removeMagazines _x} count MeleeMagazines;
|
||||
_freeSlots = [player] call BIS_fnc_invSlotsEmpty;
|
||||
{
|
||||
_item = _x select 0;
|
||||
|
||||
@@ -76,6 +76,8 @@ if (count _nearByPile > 0) then {
|
||||
} forEach (_input + _required);
|
||||
|
||||
if (_hasInput) then {
|
||||
//Remove melee magazines (BIS_fnc_invAdd and BIS_fnc_invSlotsEmpty fix)
|
||||
{player removeMagazines _x} count MeleeMagazines;
|
||||
_freeSlots = [player] call BIS_fnc_invSlotsEmpty;
|
||||
{
|
||||
_item = _x select 0;
|
||||
|
||||
@@ -93,7 +93,8 @@ if (count(_findNearestTree) >= 1) then {
|
||||
};
|
||||
|
||||
if (_proceed) then {
|
||||
|
||||
//Remove melee magazines (BIS_fnc_invAdd fix)
|
||||
{player removeMagazines _x} count MeleeMagazines;
|
||||
_invResult = false;
|
||||
_i = 0;
|
||||
for "_x" from 1 to _countOut do {
|
||||
|
||||
@@ -26,6 +26,8 @@ _weapon = _this select 1;
|
||||
_newWeapon = _this select 2;
|
||||
|
||||
//check that player has enough room in inventory
|
||||
//Remove melee magazines (BIS_fnc_invAdd and BIS_fnc_invSlotsEmpty fix)
|
||||
{player removeMagazines _x} count MeleeMagazines;
|
||||
if ((([player] call BIS_fnc_invSlotsEmpty) select 4) < 1) exitWith
|
||||
{
|
||||
closeDialog 0;
|
||||
|
||||
@@ -31,6 +31,8 @@ switch (_rounded) do {
|
||||
};
|
||||
};
|
||||
|
||||
//Remove melee magazines (BIS_fnc_invAdd fix)
|
||||
{player removeMagazines _x} count MeleeMagazines;
|
||||
_i = 0;
|
||||
while {_i < _rounded} do {
|
||||
_i = _i + 1;
|
||||
|
||||
@@ -63,9 +63,7 @@ switch _option do {
|
||||
[player,_range,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
player setVariable["cashMoney",_newWealth,true];
|
||||
|
||||
PVDZ_plr_Save = [player,(magazines player),true,true];
|
||||
publicVariableServer "PVDZ_plr_Save";
|
||||
call player_forceSave;
|
||||
|
||||
PVDZE_maintainArea = [player,1,_target];
|
||||
publicVariableServer "PVDZE_maintainArea";
|
||||
|
||||
@@ -44,6 +44,8 @@ if (_hasToolbox) then {
|
||||
r_doLoop = false;
|
||||
|
||||
if (_finished) then {
|
||||
//Remove melee magazines (BIS_fnc_invAdd fix)
|
||||
{player removeMagazines _x} count MeleeMagazines;
|
||||
_damage = [_vehicle,_hitpoint] call object_getHit;
|
||||
if (_damage < 0.10) then {
|
||||
_BreakableParts = ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitGlass5","HitGlass6","HitLGlass","HitRGlass","HitEngine","HitFuel","HitHRotor"];
|
||||
@@ -55,10 +57,7 @@ if (_hasToolbox) then {
|
||||
_isOK = [player,_part] call BIS_fnc_invAdd;
|
||||
_brokenPart = false;
|
||||
};
|
||||
} else {
|
||||
//Remove melee ammo due to the way ammo is working.
|
||||
{player removeMagazines _x} count MeleeMagazines;
|
||||
|
||||
} else {
|
||||
_isOK = [player,_part] call BIS_fnc_invAdd;
|
||||
_brokenPart = false;
|
||||
};
|
||||
|
||||
@@ -128,7 +128,9 @@ if (_finished) then {
|
||||
_keySelected = format["ItemKey%1%2",_keyColor,_keyNumber];
|
||||
|
||||
_isKeyOK = isClass(configFile >> "CfgWeapons" >> _keySelected);
|
||||
|
||||
|
||||
//Remove melee magazines (BIS_fnc_invAdd fix)
|
||||
{player removeMagazines _x} count MeleeMagazines;
|
||||
_config = _keySelected;
|
||||
_isOk = [player,_config] call BIS_fnc_invAdd;
|
||||
|
||||
|
||||
@@ -109,6 +109,8 @@ if (_qty >= _qty_in) then {
|
||||
|
||||
_isKeyOK = isClass(configFile >> "CfgWeapons" >> _keySelected);
|
||||
|
||||
//Remove melee magazines (BIS_fnc_invAdd fix)
|
||||
{player removeMagazines _x} count MeleeMagazines;
|
||||
_config = _keySelected;
|
||||
_isOk = [player,_config] call BIS_fnc_invAdd;
|
||||
waitUntil {!isNil "_isOk"};
|
||||
|
||||
@@ -127,7 +127,9 @@ if (_finished) then {
|
||||
_keySelected = format["ItemKey%1%2",_keyColor,_keyNumber];
|
||||
|
||||
_isKeyOK = isClass(configFile >> "CfgWeapons" >> _keySelected);
|
||||
|
||||
|
||||
//Remove melee magazines (BIS_fnc_invAdd fix)
|
||||
{player removeMagazines _x} count MeleeMagazines;
|
||||
_config = _keySelected;
|
||||
_isOk = [player,_config] call BIS_fnc_invAdd;
|
||||
|
||||
|
||||
@@ -116,6 +116,8 @@ if (_qty >= _qty_in) then {
|
||||
|
||||
_isKeyOK = isClass(configFile >> "CfgWeapons" >> _keySelected);
|
||||
|
||||
//Remove melee magazines (BIS_fnc_invAdd fix)
|
||||
{player removeMagazines _x} count MeleeMagazines;
|
||||
_config = _keySelected;
|
||||
_isOk = [player,_config] call BIS_fnc_invAdd;
|
||||
waitUntil {!isNil "_isOk"};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
private ["_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_textPartIn","_textPartOut","_bos","_needed","_started","_finished","_animState","_isMedic","_total_parts_out","_abort","_removed","_activatingPlayer","_traderID","_done"];
|
||||
private ["_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_textPartIn","_textPartOut","_bos","_needed","_started","_finished","_animState","_isMedic","_total_parts_out","_abort","_removed","_activatingPlayer","_traderID","_done","_actualMags"];
|
||||
// [part_out,part_in, qty_out, qty_in,];
|
||||
|
||||
if (DZE_ActionInProgress) exitWith {localize "str_epoch_player_103" call dayz_rollingMessages;};
|
||||
@@ -29,8 +29,8 @@ while {r_autoTrade} do {
|
||||
_removed = 0;
|
||||
|
||||
// check if current magazine count is greater than 20
|
||||
|
||||
if ((count (magazines player)) > 20) exitWith {localize "str_player_24" call dayz_rollingMessages; r_autoTrade = false};
|
||||
_actualMags = {!(_x in MeleeMagazines)} count (magazines player);
|
||||
if (_actualMags > 20) exitWith {localize "str_player_24" call dayz_rollingMessages; r_autoTrade = false};
|
||||
|
||||
_canAfford = false;
|
||||
if(_bos == 1) then {
|
||||
|
||||
@@ -34,6 +34,9 @@ if (_this in items player) then {
|
||||
_this call _dropOnFloor;
|
||||
};
|
||||
} else {
|
||||
//Remove melee magazines (BIS_fnc_invAdd fix)
|
||||
{player removeMagazines _x} count MeleeMagazines;
|
||||
|
||||
if !([player,_this] call BIS_fnc_invAdd) then {
|
||||
systemChat localize "str_epoch_player_107";
|
||||
_this call _dropOnFloor;
|
||||
|
||||
Reference in New Issue
Block a user