Allow players to carry primary weapon on back

Configurable by DZE_TwoPrimaries

0 do not allow primary weapon on back.
1 allow primary weapon on back, but not when holding a primary weapon in
hand.
2 (default) allow player to hold two primary weapons, one on back and
one in their hands
This commit is contained in:
icomrade
2016-04-26 14:05:37 -04:00
parent c1eb07d99d
commit 16c81e7ce2
5 changed files with 17 additions and 24 deletions

View File

@@ -387,17 +387,25 @@ if (!isDedicated) then {
(_display displayCtrl 157) ctrlShow false;
(_display displayCtrl 158) ctrlShow false;
};
// Prevent carrying 2 rifles 'exploit'
if (primaryWeapon player == "" && dayz_onBack != "" && !(dayz_onBack in MeleeWeapons)) then {
if ((DZE_TwoPrimaries == 0) && {(primaryWeapon player == "" && dayz_onBack != "" && !(dayz_onBack in MeleeWeapons))}) then {
//["gear"] call player_switchWeapon;
0 call dz_fn_switchWeapon;
closeDialog 0;
};
if (primaryWeapon player != "" && (primaryWeapon player in MeleeWeapons || dayz_onBack in MeleeWeapons)) then {
if ((DZE_TwoPrimaries == 1) && {(primaryWeapon player != "" && dayz_onBack != "" && (!(dayz_onBack in MeleeWeapons)) && !(primaryWeapon player in MeleeWeapons))}) then {
//["gear"] call player_switchWeapon;
0 call dz_fn_switchWeapon;
closeDialog 0;
};
if ((DZE_TwoPrimaries == 0) && primaryWeapon player != "" && (primaryWeapon player in MeleeWeapons || dayz_onBack in MeleeWeapons)) then {
(_display displayCtrl 1204) ctrlShow true;
} else {
(_display displayCtrl 1204) ctrlShow false;
if ((DZE_TwoPrimaries > 0) && (primaryWeapon player != "")) then {
(_display displayCtrl 1204) ctrlShow true;
} else {
(_display displayCtrl 1204) ctrlShow false;
};
};
if (DayZ_onBack != "") then {