From 16c81e7ce280b9c7a7c98c30143cd337a7412773 Mon Sep 17 00:00:00 2001 From: icomrade Date: Tue, 26 Apr 2016 14:05:37 -0400 Subject: [PATCH] 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 --- CHANGE LOG 1.0.6.txt | 1 + SQF/dayz_code/NOTE.txt | 14 -------------- SQF/dayz_code/configVariables.sqf | 4 +--- SQF/dayz_code/init/compiles.sqf | 20 ++++++++++++++------ SQF/dayz_code/system/player_spawn_2.sqf | 2 +- 5 files changed, 17 insertions(+), 24 deletions(-) delete mode 100644 SQF/dayz_code/NOTE.txt diff --git a/CHANGE LOG 1.0.6.txt b/CHANGE LOG 1.0.6.txt index 438019729..51d233600 100644 --- a/CHANGE LOG 1.0.6.txt +++ b/CHANGE LOG 1.0.6.txt @@ -27,6 +27,7 @@ [NEW] Upgraded (_DZE1,2,3,4) ArmoredSUV and Kamaz classes are now available. #1518 #1538 @McKeighan [NEW] Added waves effect during stormy weather #974 @FramedYannick @ebaydayz [NEW] Optional variable to prevent stealing from backpacks by non-friendlies at traders. Set DZE_BackpackAntiTheft = true; in init.sqf @ebaydayz +[NEW] Players can carry more than one primary weapon which allows the abillity to hide one on their back, configure using DZE_TwoPrimaries. see ConfigVariable.sqf for details @icomrade [CHANGED] Many duplicate functions and variables were renamed. See Documents\1.0.6 Variable Name Changes.txt @ebaydayz [CHANGED] Several weapon, item and tool classnames changed. Admins see SQL\1.0.6_Updates @ebaydayz diff --git a/SQF/dayz_code/NOTE.txt b/SQF/dayz_code/NOTE.txt deleted file mode 100644 index b0602feb3..000000000 --- a/SQF/dayz_code/NOTE.txt +++ /dev/null @@ -1,14 +0,0 @@ -Convert traders + loot (if old system) to ItemBloodbag - -trap_monitor.fsm is no more! - -//////////////////////////////////////// -SELF ACTIONS VARIABLES -//////////////////////////////////////// -s_player_boil = -1; is now a_player_boil = true; -a_player_cooking = true; -- NEW, old -1 var is still used??? -MAKE SURE "ItemFuelBarrel" is in refuel can list - -////////SERVER STUFF/////// -REMOVE PVDZE_SEND PROJECTILE FOR FLARE AND CHEMLIGHT 0 1 -PVDZE_send = [_x,"RoadFlare",[_projectile,1]]; \ No newline at end of file diff --git a/SQF/dayz_code/configVariables.sqf b/SQF/dayz_code/configVariables.sqf index 9aa4d4699..bf60f8e63 100644 --- a/SQF/dayz_code/configVariables.sqf +++ b/SQF/dayz_code/configVariables.sqf @@ -20,6 +20,7 @@ DynamicVehicleDamageHigh = 100; // Max damage random vehicles can spawn with DynamicVehicleFuelLow = 0; // Min fuel random vehicles can spawn with DynamicVehicleFuelHigh = 100; // Max fuel random vehicles can spawn with +DZE_TwoPrimaries = 2; // 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 DZE_AntiWallLimit = 3; // Number of activations before player_antiWall kills player for glitching attempt. Lower is stricter, but may result in false positives. DZE_DamageBeforeMaint = 0.09; // Minimum damage built items must have before they can be maintained DZE_DeathMsgChat = "none"; //"none","global","side","system" Display death messages in selected chat channel. @@ -42,9 +43,6 @@ MaxAmmoBoxes = 3; // Max number of random Supply_Crate_DZE to spawn around the m MaxMineVeins = 50; // Max number of random mine veins to spawn around the map timezoneswitch = 0; // Changes murderMenu times with this offset in hours. - - - /* Developers: diff --git a/SQF/dayz_code/init/compiles.sqf b/SQF/dayz_code/init/compiles.sqf index b58cf2d6e..3a469755f 100644 --- a/SQF/dayz_code/init/compiles.sqf +++ b/SQF/dayz_code/init/compiles.sqf @@ -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 { diff --git a/SQF/dayz_code/system/player_spawn_2.sqf b/SQF/dayz_code/system/player_spawn_2.sqf index 6415c4820..5e06606d6 100644 --- a/SQF/dayz_code/system/player_spawn_2.sqf +++ b/SQF/dayz_code/system/player_spawn_2.sqf @@ -432,7 +432,7 @@ while {1 == 1} do { }; //Two primary guns pickup exploit fix - if ((primaryWeapon player != "") && (!(primaryWeapon player in MeleeWeapons)) && (dayz_onBack != "") && (!(dayz_onBack in MeleeWeapons)) && (isNull (findDisplay 106)) && + if ((DZE_TwoPrimaries < 2) && (primaryWeapon player != "") && (!(primaryWeapon player in MeleeWeapons)) && (dayz_onBack != "") && (!(dayz_onBack in MeleeWeapons)) && (isNull (findDisplay 106)) && (animationState player != "amovpknlmstpslowwrfldnon_amovpknlmstpsraswrfldnon" OR animationState player != "amovpercmstpslowwrfldnon_amovpercmstpsraswrfldnon" OR animationState player != "amovpercmstpslowwrfldnon_amovpercmstpsraswrfldnon")) then { localize "str_player_ammo_2primary" call dayz_rollingMessages; player playActionNow "stop";