diff --git a/SQF/dayz_code/Configs/RscDisplay/safegui.hpp b/SQF/dayz_code/Configs/RscDisplay/safegui.hpp index 85e1e343f..7cb33256a 100644 --- a/SQF/dayz_code/Configs/RscDisplay/safegui.hpp +++ b/SQF/dayz_code/Configs/RscDisplay/safegui.hpp @@ -458,7 +458,7 @@ class ComboLockUI y = 0.762017; w = 0.201064; h = 0.233964; - onButtonClick = "keypadCancel = false; if (!isNull dayz_selectedDoor) then {call player_unlockDoor;};"; + onButtonClick = "keypadCancel = false; if (!isNull dayz_selectedDoor) then {call player_unlockDoor;} else {((ctrlParent (_this select 0)) closeDisplay 2);};"; }; }; }; diff --git a/SQF/dayz_code/actions/changeCode.sqf b/SQF/dayz_code/actions/changeCode.sqf new file mode 100644 index 000000000..0c50895dc --- /dev/null +++ b/SQF/dayz_code/actions/changeCode.sqf @@ -0,0 +1,97 @@ +/* + changeCode - Safe, Lockbox and Door code changing script by salival (https://github.com/oiad) +*/ + +if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;}; +dayz_actionInProgress = true; + +if (isNull cursorTarget) exitWith {systemChat "cursorTarget isNull!";}; + +private ["_backupCode","_badCode","_cursorTarget","_dialog","_dir","_doorFriends","_isDoor","_isLockBox","_isSafe","_isStorage","_location","_lockCode","_object","_ownerID","_typeOf","_vector"]; + +_cursorTarget = _this select 3; +_typeOf = typeOf (_cursorTarget); + +_isSafe = _typeOf == "VaultStorage"; +_isLockBox = _typeOf == "LockBoxStorage"; +_isStorage = (_isSafe || _isLockBox); +_isDoor = _typeOf in DZE_DoorsLocked; + +_badCode = false; + +_dialog = call { + if (_isLockBox) exitwith {"KeyPadUI"}; + if (_isSafe) exitwith {"SafeKeyPad"}; + if (_isDoor) exitwith {"ComboLockUI"}; +}; + +if (_isStorage) then { + _backupCode = dayz_combination; + dayz_combination = ""; + dayz_selectedVault = objNull; +} else { + DZE_topCombo = 0; + DZE_midCombo = 0; + DZE_botCombo = 0; + _backupCode = DZE_Lock_Door; + DZE_Lock_Door = ""; + dayz_selectedDoor = objNull; +}; + +createDialog _dialog; + +waitUntil {!dialog}; + +if (keypadCancel) exitWith { + dayz_actionInProgress = false; + if (_isStorage) then {dayz_combination = _backupCode;} else {DZE_Lock_Door = _backupCode;}; +}; + +if (_isStorage) then { + if (_isSafe) then { + if ((parseNumber dayz_combination) > 9999 || count (toArray (dayz_combination)) < 4) then {_badCode = true;}; + } else { + _lockCode = dayz_combination call fnc_lockCode; + if (typeName _lockCode == "SCALAR") then {_badCode = true;}; + }; +} else { + if (parseNumber DZE_Lock_Door == 0) then {_badCode = true}; +}; + +if (_badCode) exitWith { + dayz_actionInProgress = false; + if (_isStorage) then {dayz_combination = _backupCode;} else {DZE_Lock_Door = _backupCode;}; + systemChat localize "STR_CL_CC_CODE_INVALID"; +}; + +if (_isStorage) then { + sk_changeCode = [player,_cursorTarget,dayz_combination,dayz_authKey]; + publicVariableServer "sk_changeCode"; +} else { + _location = _cursorTarget getVariable["OEMPos",getPosATL _cursorTarget]; + _dir = getDir _cursorTarget; + _vector = [vectorDir _cursorTarget,vectorUp _cursorTarget]; + + _object = createVehicle [_typeOf, [0,0,0], [], 0, "CAN_COLLIDE"]; + _object setDir _dir; + _object setVectorDirAndUp _vector; + _object setPosATL _location; + _object setVariable ["memDir",_dir,true]; + + if (DZE_permanentPlot) then { + _ownerID = _cursorTarget getVariable["ownerPUID","0"]; + _object setVariable ["ownerPUID",_ownerID,true]; + _doorFriends = _cursorTarget getVariable ["doorfriends",[]]; + if (isNil "_ownerID" || _ownerID == "0") then {_ownerID = dayz_playerUID;}; + if (count _doorFriends == 0) then {_doorFriends = [[dayz_playerUID,toArray (name player)]];}; + _object setVariable ["doorfriends",_doorFriends,true]; + PVDZE_obj_Swap = [DZE_Lock_Door,_object,[_dir,_location,_ownerID,_vector],_typeOf,_cursorTarget,player,_doorFriends,dayz_authKey]; + } else { + PVDZE_obj_Swap = [DZE_Lock_Door,_object,[_dir,_location,_vector],_typeOf,_cursorTarget,player,[],dayz_authKey]; + }; + + publicVariableServer "PVDZE_obj_Swap"; +}; + +systemChat format[localize "STR_CL_CC_CODE_CHANGED",if (_isStorage) then {if (_isSafe) then {dayz_combination} else {(dayz_combination call fnc_lockCode)}} else {DZE_Lock_Door}]; +dayz_actionInProgress = false; diff --git a/SQF/dayz_code/actions/modular_build.sqf b/SQF/dayz_code/actions/modular_build.sqf index 1d7821e85..d54b1fd39 100644 --- a/SQF/dayz_code/actions/modular_build.sqf +++ b/SQF/dayz_code/actions/modular_build.sqf @@ -443,42 +443,78 @@ if (_canBuild select 0) then { _combinationDisplay = ""; //define new display - switch (_lockable) do { //generate random combinations depending on item type + call { //generate random combinations depending on item type - case 2: { // 2 lockbox - _combination_1 = (floor(random 3)) + 100; // 100=red,101=green,102=blue - _combination_2 = floor(random 10); - _combination_3 = floor(random 10); - _combination = format["%1%2%3",_combination_1,_combination_2,_combination_3]; - dayz_combination = _combination; - if (_combination_1 == 100) then { - _combination_1_Display = localize "STR_TEAM_RED"; + if (_lockable == 2) exitwith { // 2 lockbox + dayz_combination = ""; + dayz_selectedVault = objNull; + + createDialog "KeyPadUI"; + waitUntil {!dialog}; + + _combinationDisplay = dayz_combination call fnc_lockCode; + if (keypadCancel || {typeName _combinationDisplay == "SCALAR"}) then { + _combination_1 = (floor(random 3)) + 100; // 100=red,101=green,102=blue + _combination_2 = floor(random 10); + _combination_3 = floor(random 10); + _combination = format["%1%2%3",_combination_1,_combination_2,_combination_3]; + dayz_combination = _combination; + if (_combination_1 == 100) then { + _combination_1_Display = localize "STR_TEAM_RED"; + }; + if (_combination_1 == 101) then { + _combination_1_Display = localize "STR_TEAM_GREEN"; + }; + if (_combination_1 == 102) then { + _combination_1_Display = localize "STR_TEAM_BLUE"; + }; + _combinationDisplay = format["%1%2%3",_combination_1_Display,_combination_2,_combination_3]; + } else { + _combination = dayz_combination; }; - if (_combination_1 == 101) then { - _combination_1_Display = localize "STR_TEAM_GREEN"; - }; - if (_combination_1 == 102) then { - _combination_1_Display = localize "STR_TEAM_BLUE"; - }; - _combinationDisplay = format["%1%2%3",_combination_1_Display,_combination_2,_combination_3]; }; - case 3: { // 3 combolock - _combination_1 = floor(random 10); - _combination_2 = floor(random 10); - _combination_3 = floor(random 10); - _combination = format["%1%2%3",_combination_1,_combination_2,_combination_3]; - DZE_Lock_Door = _combination; + if (_lockable == 3) exitwith { // 3 combolock + DZE_topCombo = 0; + DZE_midCombo = 0; + DZE_botCombo = 0; + DZE_Lock_Door = ""; + dayz_selectedDoor = objNull; + + dayz_actionInProgress = false; + createDialog "ComboLockUI"; + waitUntil {!dialog}; + dayz_actionInProgress = true; + + if (keypadCancel || {parseNumber DZE_Lock_Door == 0}) then { + _combination_1 = floor(random 10); + _combination_2 = floor(random 10); + _combination_3 = floor(random 10); + _combination = format["%1%2%3",_combination_1,_combination_2,_combination_3]; + DZE_Lock_Door = _combination; + } else { + _combination = DZE_Lock_Door; + }; _combinationDisplay = _combination; }; - case 4: { // 4 safe - _combination_1 = floor(random 10); - _combination_2 = floor(random 10); - _combination_3 = floor(random 10); - _combination_4 = floor(random 10); - _combination = format["%1%2%3%4",_combination_1,_combination_2,_combination_3,_combination_4]; - dayz_combination = _combination; + if (_lockable == 4) exitwith { // 4 safe + dayz_combination = ""; + dayz_selectedVault = objNull; + + createDialog "SafeKeyPad"; + waitUntil {!dialog}; + + if (keypadCancel || {(parseNumber dayz_combination) > 9999} || {count (toArray (dayz_combination)) < 4}) then { + _combination_1 = floor(random 10); + _combination_2 = floor(random 10); + _combination_3 = floor(random 10); + _combination_4 = floor(random 10); + _combination = format["%1%2%3%4",_combination_1,_combination_2,_combination_3,_combination_4]; + dayz_combination = _combination; + } else { + _combination = dayz_combination; + }; _combinationDisplay = _combination; }; }; diff --git a/SQF/dayz_code/actions/player_build.sqf b/SQF/dayz_code/actions/player_build.sqf index 392bd7645..f99430a90 100644 --- a/SQF/dayz_code/actions/player_build.sqf +++ b/SQF/dayz_code/actions/player_build.sqf @@ -56,7 +56,7 @@ _needNear = getArray (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> }; if (_x == "workshop") exitwith { _distance = 3; - _isNear = count (nearestObjects [_pos, ["Wooden_shed_DZ","WoodShack_DZ","WorkBench_DZ"], _distance]); + _isNear = count (nearestObjects [_pos, DZE_Workshops, _distance]); if (_isNear == 0) then { _abort = true; _reason = localize "STR_EPOCH_WORKBENCH_NEARBY"; @@ -362,42 +362,78 @@ if (_canBuild select 0) then { _combinationDisplay = ""; - switch (_lockable) do { + call { //generate random combinations depending on item type - case 2: { // 2 lockbox - _combination_1 = (floor(random 3)) + 100; // 100=red,101=green,102=blue - _combination_2 = floor(random 10); - _combination_3 = floor(random 10); - _combination = format["%1%2%3",_combination_1,_combination_2,_combination_3]; - dayz_combination = _combination; - if (_combination_1 == 100) then { - _combination_1_Display = localize "STR_TEAM_RED"; + if (_lockable == 2) exitwith { // 2 lockbox + dayz_combination = ""; + dayz_selectedVault = objNull; + + createDialog "KeyPadUI"; + waitUntil {!dialog}; + + _combinationDisplay = dayz_combination call fnc_lockCode; + if (keypadCancel || {typeName _combinationDisplay == "SCALAR"}) then { + _combination_1 = (floor(random 3)) + 100; // 100=red,101=green,102=blue + _combination_2 = floor(random 10); + _combination_3 = floor(random 10); + _combination = format["%1%2%3",_combination_1,_combination_2,_combination_3]; + dayz_combination = _combination; + if (_combination_1 == 100) then { + _combination_1_Display = localize "STR_TEAM_RED"; + }; + if (_combination_1 == 101) then { + _combination_1_Display = localize "STR_TEAM_GREEN"; + }; + if (_combination_1 == 102) then { + _combination_1_Display = localize "STR_TEAM_BLUE"; + }; + _combinationDisplay = format["%1%2%3",_combination_1_Display,_combination_2,_combination_3]; + } else { + _combination = dayz_combination; }; - if (_combination_1 == 101) then { - _combination_1_Display = localize "STR_TEAM_GREEN"; - }; - if (_combination_1 == 102) then { - _combination_1_Display = localize "STR_TEAM_BLUE"; - }; - _combinationDisplay = format["%1%2%3",_combination_1_Display,_combination_2,_combination_3]; }; - case 3: { // 3 combolock - _combination_1 = floor(random 10); - _combination_2 = floor(random 10); - _combination_3 = floor(random 10); - _combination = format["%1%2%3",_combination_1,_combination_2,_combination_3]; - DZE_Lock_Door = _combination; + if (_lockable == 3) exitwith { // 3 combolock + DZE_topCombo = 0; + DZE_midCombo = 0; + DZE_botCombo = 0; + DZE_Lock_Door = ""; + dayz_selectedDoor = objNull; + + dayz_actionInProgress = false; + createDialog "ComboLockUI"; + waitUntil {!dialog}; + dayz_actionInProgress = true; + + if (keypadCancel || {parseNumber DZE_Lock_Door == 0}) then { + _combination_1 = floor(random 10); + _combination_2 = floor(random 10); + _combination_3 = floor(random 10); + _combination = format["%1%2%3",_combination_1,_combination_2,_combination_3]; + DZE_Lock_Door = _combination; + } else { + _combination = DZE_Lock_Door; + }; _combinationDisplay = _combination; }; - case 4: { // 4 safe - _combination_1 = floor(random 10); - _combination_2 = floor(random 10); - _combination_3 = floor(random 10); - _combination_4 = floor(random 10); - _combination = format["%1%2%3%4",_combination_1,_combination_2,_combination_3,_combination_4]; - dayz_combination = _combination; + if (_lockable == 4) exitwith { // 4 safe + dayz_combination = ""; + dayz_selectedVault = objNull; + + createDialog "SafeKeyPad"; + waitUntil {!dialog}; + + if (keypadCancel || {(parseNumber dayz_combination) > 9999} || {count (toArray (dayz_combination)) < 4}) then { + _combination_1 = floor(random 10); + _combination_2 = floor(random 10); + _combination_3 = floor(random 10); + _combination_4 = floor(random 10); + _combination = format["%1%2%3%4",_combination_1,_combination_2,_combination_3,_combination_4]; + dayz_combination = _combination; + } else { + _combination = dayz_combination; + }; _combinationDisplay = _combination; }; }; diff --git a/SQF/dayz_code/actions/player_upgrade.sqf b/SQF/dayz_code/actions/player_upgrade.sqf index 1d36774de..12ea3b1f9 100644 --- a/SQF/dayz_code/actions/player_upgrade.sqf +++ b/SQF/dayz_code/actions/player_upgrade.sqf @@ -117,14 +117,25 @@ if ((count _upgrade) > 0) then { _object setPosATL _location; if (_lockable == 3 && {!(_classname in ["WoodenGate_2_DZ","WoodenGate_3_DZ","WoodenGate_4_DZ"])}) then { + DZE_topCombo = 0; + DZE_midCombo = 0; + DZE_botCombo = 0; + DZE_Lock_Door = ""; + dayz_selectedDoor = objNull; - _combination_1 = floor(random 10); - _combination_2 = floor(random 10); - _combination_3 = floor(random 10); - _combination = format["%1%2%3",_combination_1,_combination_2,_combination_3]; + createDialog "ComboLockUI"; + waitUntil {!dialog}; + if (keypadCancel || {parseNumber DZE_Lock_Door == 0}) then { + _combination_1 = floor(random 10); + _combination_2 = floor(random 10); + _combination_3 = floor(random 10); + _combination = format["%1%2%3",_combination_1,_combination_2,_combination_3]; + DZE_Lock_Door = _combination; + } else { + _combination = DZE_Lock_Door; + }; _objectCharacterID = _combination; - DZE_Lock_Door = _combination; format[localize "str_epoch_player_158",_combination,_text] call dayz_rollingMessages; systemChat format[localize "str_epoch_player_158",_combination,_text]; diff --git a/SQF/dayz_code/compile/fn_selfActions.sqf b/SQF/dayz_code/compile/fn_selfActions.sqf index b50bcf47a..61918cd58 100644 --- a/SQF/dayz_code/compile/fn_selfActions.sqf +++ b/SQF/dayz_code/compile/fn_selfActions.sqf @@ -655,11 +655,16 @@ if (!isNull _cursorTarget && {!_inVehicle} && {!_isPZombie} && {player distance if (s_player_packvault < 0) then { s_player_packvault = player addAction [format["%1",format[localize "STR_EPOCH_ACTIONS_PACK",_text]], "\z\addons\dayz_code\actions\vault_pack.sqf",_cursorTarget, 0, false, true]; }; + if (s_player_changeVaultCode < 0 && (_characterID == dayz_combination || _ownerID == _uid)) then { + s_player_changeVaultCode = player addAction [format[localize "STR_CL_CC_CODE_CHANGE",_text], "\z\addons\dayz_code\actions\changeCode.sqf",_cursorTarget, 0, false, true]; + }; } else { player removeAction s_player_packvault; s_player_packvault = -1; player removeAction s_player_lockvault; s_player_lockvault = -1; + player removeAction s_player_changeVaultCode; + s_player_changeVaultCode = -1; }; //Player Deaths @@ -723,23 +728,30 @@ if (!isNull _cursorTarget && {!_inVehicle} && {!_isPZombie} && {player distance }; // downgrade system - if (DZE_Lock_Door == _characterID && {!keypadCancel} && {_cursorTarget isKindOf "Land_DZE_WoodDoorLocked_Base" || _cursorTarget isKindOf "CinderWallDoorLocked_DZ_Base"}) then { - if ((s_player_lastTarget select 1) != _cursorTarget) then { - if (s_player_downgrade_build > 0) then { - player removeAction s_player_downgrade_build; - s_player_downgrade_build = -1; + if (DZE_Lock_Door == _characterID && !keypadCancel) then { + if (_cursorTarget isKindOf "Land_DZE_WoodDoorLocked_Base" || _cursorTarget isKindOf "CinderWallDoorLocked_DZ_Base") then { + if ((s_player_lastTarget select 1) != _cursorTarget) then { + if (s_player_downgrade_build > 0) then { + player removeAction s_player_downgrade_build; + s_player_downgrade_build = -1; + }; }; - }; - if (s_player_downgrade_build < 0) then { - _hasAccess = [player, _cursorTarget] call FNC_check_access; - if ((_hasAccess select 0) || {_hasAccess select 2} || {_hasAccess select 3}) then { - s_player_lastTarget set [1,_cursorTarget]; - s_player_downgrade_build = player addAction [format[localize "STR_EPOCH_ACTIONS_REMLOCK",_text], "\z\addons\dayz_code\actions\player_buildingDowngrade.sqf",_cursorTarget, -2, false, true]; + if (s_player_downgrade_build < 0) then { + _hasAccess = [player, _cursorTarget] call FNC_check_access; + if ((_hasAccess select 0) || {_hasAccess select 2} || {_hasAccess select 3}) then { + s_player_lastTarget set [1,_cursorTarget]; + s_player_downgrade_build = player addAction [format[localize "STR_EPOCH_ACTIONS_REMLOCK",_text], "\z\addons\dayz_code\actions\player_buildingDowngrade.sqf",_cursorTarget, -2, false, true]; + }; }; + }; + if (s_player_changeDoorCode < 0 && {_typeOfCursorTarget in DZE_DoorsLocked}) then { + s_player_changeDoorCode = player addAction [format[localize "STR_CL_CC_CODE_CHANGE",_text], "\z\addons\dayz_code\actions\changeCode.sqf",_cursorTarget, 0, false, true]; }; } else { player removeAction s_player_downgrade_build; s_player_downgrade_build = -1; + player removeAction s_player_changeDoorCode; + s_player_changeDoorCode = -1; }; // inplace maintenance tool @@ -996,6 +1008,10 @@ if (!isNull _cursorTarget && {!_inVehicle} && {!_isPZombie} && {player distance s_player_manageDoor = -1; player removeAction s_player_hide_body; s_player_hide_body = -1; + player removeAction s_player_changeDoorCode; + s_player_changeDoorCode = -1; + player removeAction s_player_changeVaultCode; + s_player_changeVaultCode = -1; }; //Dog actions on player self diff --git a/SQF/dayz_code/init/variables.sqf b/SQF/dayz_code/init/variables.sqf index 6aa9bf2a6..04bdda083 100644 --- a/SQF/dayz_code/init/variables.sqf +++ b/SQF/dayz_code/init/variables.sqf @@ -197,6 +197,8 @@ if (!isDedicated) then { vectorActions = -1; s_player_manageDoor = -1; s_player_hide_body = -1; + s_player_changeDoorCode = -1; + s_player_changeVaultCode = -1; }; call dayz_resetSelfActions; diff --git a/SQF/dayz_server/compile/server_changeCode.sqf b/SQF/dayz_server/compile/server_changeCode.sqf new file mode 100644 index 000000000..fd94e82b5 --- /dev/null +++ b/SQF/dayz_server/compile/server_changeCode.sqf @@ -0,0 +1,83 @@ +/* + changeCode - Safe, Lockbox and Door code changing script by salival (https://github.com/oiad) +*/ + +"SK_changeCode" addPublicVariableEventHandler {(_this select 1) call server_changeCode}; + +server_changeCode = { + private ["_backpacks","_charID","_characterID","_clientID","_coins","_dir","_holder","_inventory","_key","_lockedClass","_magazines","_message","_name","_object","_objectID","_objectUID","_ownerID","_ownerPUID","_player","_playerUID","_pos","_typeOf","_vector","_weapons","_worldSpace","_clientKey","_exitReason"]; + + if (count _this < 4) exitWith {diag_log "server_changeCode error: Improper parameter format";}; + + _player = _this select 0; + _object = _this select 1; + _characterID = _this select 2; + _clientKey = _this select 3; + + _typeOf = typeOf _object; + if !(_typeOf in DZE_unlockedStorage) exitWith {diag_log "server_changeCode called with invalid storage object!"}; + + _lockedClass = getText (configFile >> "CfgVehicles" >> _typeOf >> "lockedClass"); + _pos = _object getVariable ["OEMPos",getPosATL _object]; + _dir = getDir _object; + _vector = [vectorDir _object, vectorUp _object]; + _charID = _object getVariable ["CharacterID","0"]; + _objectID = _object getVariable ["ObjectID","0"]; + _objectUID = _object getVariable ["ObjectUID","0"]; + _ownerID = _object getVariable ["ownerPUID","0"]; + //_name = if (alive _player) then {name _player;} else {"unknown player";}; + _name = ["unknown player",name _player] select (alive _player); + _clientID = owner _player; + _playerUID = getPlayerUID _player; + + if (isNull _player) then {diag_log "ERROR: server_changeCode called with Null player object";}; + if (isNull _object) exitWith {diag_log format["ERROR: server_changeCode called with Null object by %1 (%2).",_name,_playerUID];}; + + _exitReason = [_this,"changeCode",_pos,_clientKey,_PlayerUID,_player] call server_verifySender; + if (_exitReason != "") exitWith {diag_log _exitReason}; + + _weapons = getWeaponCargo _object; + _magazines = getMagazineCargo _object; + _backpacks = getBackpackCargo _object; + if (Z_singleCurrency) then {_coins = _object getVariable [Z_MoneyVariable,0];}; + + [_objectID,_objectUID,_object] call server_deleteObjDirect; + + _holder = _lockedClass createVehicle [0,0,0]; + _holder setDir _dir; + _holder setVariable ["memDir",_dir,true]; + _holder setVectorDirAndUp _vector; + _holder setPosATL _pos; + _holder setVariable ["CharacterID",_characterID,true]; + _holder setVariable ["OEMPos",_pos,true]; + + if (DZE_permanentPlot) then { + _ownerPUID = if (_charID == "0000" || _charID == "10000") then {_playerUID} else {_ownerID}; + _worldSpace = [_dir,_pos,_ownerPUID,_vector]; + _holder setVariable ["ownerPUID",_ownerPUID,true]; + } else { + _worldSpace = [_dir,_pos]; + }; + + if (Z_singleCurrency) then {_holder setVariable [Z_MoneyVariable,_coins,true];}; + + _objectUID = _worldSpace call dayz_objectUID2; + _holder setVariable ["ObjectUID",_objectUID,true]; + + deleteVehicle _object; + + _inventory = [_weapons,_magazines,_backpacks]; + _holder setVariable ["WeaponCargo",_weapons,false]; + _holder setVariable ["MagazineCargo",_magazines,false]; + _holder setVariable ["BackpackCargo",_backpacks,false]; + + [_characterID,_holder,_worldSpace,_inventory,_player,_clientKey] call server_publishObj; + + if (Z_singleCurrency) then { + _key = format["CHILD:309:%1:",_objectUID] + str _inventory + ":" + str _coins + ":"; + _key call server_hiveWrite; + }; + + _message = format ["CHANGE CODE: %1 (%2) changed the code for %3 to %4 @%5 %6",_name,_playerUID,_lockedClass,_characterID,mapGridPosition _player,_pos]; + diag_log _message; +}; diff --git a/SQF/dayz_server/compile/server_swapObject.sqf b/SQF/dayz_server/compile/server_swapObject.sqf index 45030a092..0d331dbc4 100644 --- a/SQF/dayz_server/compile/server_swapObject.sqf +++ b/SQF/dayz_server/compile/server_swapObject.sqf @@ -83,7 +83,7 @@ if (DZE_GodModeBase && {!(_class in DZE_GodModeBaseExclude)}) then { _object addMPEventHandler ["MPKilled",{_this call vehicle_handleServerKilled;}]; }; -if (count _inv > 0) then { +if (count _inv > 0 && {_class in ["Wooden_shed2_DZ","WoodShack2_DZ","StorageShed2_DZ","GunRack2_DZ","WoodCrate2_DZ","VaultStorage2Locked","LockboxStorage2Locked","TentStorage0","TentStorage1","TentStorage2","TentStorage3","TentStorage4""DomeTentStorage0","DomeTentStorage1","DomeTentStorage2","DomeTentStorage3","DomeTentStorage4","DesertTentStorage0","DesertTentStorage1","DesertTentStorage2","DesertTentStorage3","DesertTentStorage4","StashSmall1","StashSmall2","StashSmall3","StashSmall4","StashMedium","StashMedium1","StashMedium2","StashMedium3","StashMedium4"]}) then { [_weapons,_magazines,_backpacks,_object] call fn_addCargo; }; diff --git a/SQF/dayz_server/init/server_functions.sqf b/SQF/dayz_server/init/server_functions.sqf index b357257f5..9adc68a10 100644 --- a/SQF/dayz_server/init/server_functions.sqf +++ b/SQF/dayz_server/init/server_functions.sqf @@ -50,6 +50,8 @@ spawn_mineveins = compile preprocessFileLineNumbers "\z\addons\dayz_server\compi spawn_roadblocks = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\spawn_roadblocks.sqf"; spawn_vehicles = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\spawn_vehicles.sqf"; +call compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_changeCode.sqf"; + server_medicalSync = { private ["_player","_array"]; @@ -253,4 +255,4 @@ array_reduceSize = { // Precise base building 1.0.5 call compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\kk_functions.sqf"; -#include "mission_check.sqf" +#include "mission_check.sqf" \ No newline at end of file diff --git a/Server Files/DZE_Server_Config/BattlEye/publicvariable.txt b/Server Files/DZE_Server_Config/BattlEye/publicvariable.txt index 8055ddca2..4f7b7e2f7 100644 --- a/Server Files/DZE_Server_Config/BattlEye/publicvariable.txt +++ b/Server Files/DZE_Server_Config/BattlEye/publicvariable.txt @@ -1,5 +1,5 @@ //new -5 !=remEx(Field|FP) !=(PVCDZ_obj_GutBody|BIS_effects_gepv) !=PVDZ_(hlt_Bleed|obj_(Delete|Publish|RoadFlare|Destroy|Fire)|veh_Save|veh_SF) !=PVDZ_(plr_(Death|Login[12]|LoginRecord|Save|SwitchMove)|Server(_Simulation|StoreVar|_UpdateGroup)) !=PVDZ_(playerMedicalSync|groupInvite|send|sec_atp) !=PVDZ_objgather_(Delete|Knockdown) !=PVDZE_(obj_(Swap|Trade)|maintainArea|PingSend|veh_(Lock|Publish2|Upgrade)|handleSafeGear|plr_(DeathB|FriendRQ)) +5 !=remEx(Field|FP) !=(PVCDZ_obj_GutBody|BIS_effects_gepv) !=PVDZ_(hlt_Bleed|obj_(Delete|Publish|RoadFlare|Destroy|Fire)|veh_Save|veh_SF) !=PVDZ_(plr_(Death|Login[12]|LoginRecord|Save|SwitchMove)|Server(_Simulation|StoreVar|_UpdateGroup)) !=PVDZ_(playerMedicalSync|groupInvite|send|sec_atp) !=PVDZ_objgather_(Delete|Knockdown) !=PVDZE_(obj_(Swap|Trade)|maintainArea|PingSend|veh_(Lock|Publish2|Upgrade)|handleSafeGear|plr_(DeathB|FriendRQ)) !=SK_changeCode 1=BIS_effects_gepv|PVDZ_(hlt_Bleed|obj_Delete|obj_Destroy|obj_Publish|plr_Death|plr_LoginRecord|sec_atp|send) 1=PVDZ_veh_(Save|SF) 1=PVDZE_obj_Swap diff --git a/Server Files/DZE_Server_Config/BattlEye/scripts.txt b/Server Files/DZE_Server_Config/BattlEye/scripts.txt index 6d3d25447..8e05ba828 100644 --- a/Server Files/DZE_Server_Config/BattlEye/scripts.txt +++ b/Server Files/DZE_Server_Config/BattlEye/scripts.txt @@ -16,7 +16,7 @@ 5 closeDisplay !"'closeDisplay'" !"closeDisplay 0" !"closeDisplay 2" !"if (!isNil \"closeDisplay\") then {" 1 compile !"ca\\communityconfiguration" !"ca\\Data\\" !"ca\\missions" !"ca\\modules" !"ca\\ui\\" !"ca\\Warfare2\\" !"scriptName \"Functions\\systems\\fn_inv" !"scriptName \"MP\\data\\script" !"code = compile preprocessFileLineNumbers (BIS_PathMPscriptCommands" !"t = missionConfigFile >> \"onMinimapScript" !="_this call (call compile GetText (configFile >> \"CfgAmmo\" >> _amm >> \"muzzleEffect\"));" !"z\\addons\\dayz_code\\" !"_menu ctrlSetEventHandler [\"ButtonClick\",_compile];\n};\n_pos set [3" !"{ _x set [1, compile (_x select 1)]; }" !"silver_1oz_b);\n\n{ \nif (!isNil {call compile" !"Var = compile format[\"epoch_death_board_record_" 5 createAgent !="_agent = if (_type == \"Pastor\") then {createAgent [_type, _Pos, [], 0, \"NONE\"]} else {createAgent [_type, _Pos, [], 0, \"FORM\"]};" !="_dog = createAgent [_type, _Pos, [], 0, \"NONE\"];" !="\n\n\n_type = _unitTypes call BIS_fnc_selectRandom;\n_agent = createAgent [_type, _position, [], 0, \"CAN_COLLIDE\"];\n_agent setDir (r" -5 createDialog !="_region = createDialog \"RscDisplaySpawnSelecter\";" !="_gender = createDialog 'RscDisplayGenderSelect';" !="_dialog = createDialog \"bloodTest\";" !="createDialog 'RscDisplayCraftingMenu';" !="createDialog \"DAYZ_PADLOCK\";" !"createDialog 'horde_journal_" !"Z_ResetContainer = true;\ncreateDialog \"AdvancedTrading\";" !"createDialog \"DoorManagement\";\ncall DoorNearbyHumans;" !="createDialog \"ComboLockUI\";" !"createdialog \"PlotManagement\";\ncall PlotNearbyHumans;" !"_trader_data = (_this select 3);\n\n_dialog = createdialog \"TraderDialog\";" !"_ok = createDialog \"KeypadUI\";" !"EpochDeathBoardLoad = {\ncreatedialog \"EpochDeathBoardDialog\";" !="if(DZE_doorManagement) then {createdialog \"DoorAccess\";} else {createdialog \"ComboLockUI\";};" !"\ndisableSerialization;\ncreateDialog \"DZ_GroupDialog\";" +5 createDialog !="_region = createDialog \"RscDisplaySpawnSelecter\";" !="_gender = createDialog 'RscDisplayGenderSelect';" !="_dialog = createDialog \"bloodTest\";" !="createDialog 'RscDisplayCraftingMenu';" !="createDialog \"DAYZ_PADLOCK\";" !"createDialog 'horde_journal_" !"Z_ResetContainer = true;\ncreateDialog \"AdvancedTrading\";" !"createDialog \"DoorManagement\";\ncall DoorNearbyHumans;" !="createDialog \"ComboLockUI\";" !"createdialog \"PlotManagement\";\ncall PlotNearbyHumans;" !"_trader_data = (_this select 3);\n\n_dialog = createdialog \"TraderDialog\";" !"_ok = createDialog \"KeypadUI\";" !"EpochDeathBoardLoad = {\ncreatedialog \"EpochDeathBoardDialog\";" !="if(DZE_doorManagement) then {createdialog \"DoorAccess\";} else {createdialog \"ComboLockUI\";};" !"\ndisableSerialization;\ncreateDialog \"DZ_GroupDialog\";" !"createDialog _dialog;\n\nwaitUntil {!dialog};\n\nif (keypadCancel) exitWith {" 5 createDisplay 5 createMarker !"\"createMarkerLocal\"," !"rcreateMarkerLocal" !"if (isnil 'BIS_GITA_fnc_createMarkers' || false) then {" !"_marker = createMarkerLocal [format[\"groupMember" 5 createUnit !="_newUnit = _group createUnit [_class,respawn_west_original,[],0,\"NONE\"];" !="BIS_MPF_logic = BIS_MPF_dummygroup createUnit [\"Logic\", [1000,10,0], [], 0, \"NONE\"];" @@ -69,7 +69,7 @@ 5 setViewDistance 5 sideLogic !"publicVariable \"BIS_MPF_logic\";" 5 switchCamera !"\"switchCamera\", " !"rswitchCamera" !"player switchCamera _currentCamera;\nif (_currentWpn !=" !"< 150) && random 1 > 0.5) then {\n_killer switchcamera" -5 systemChat !="systemChat format[localize \"str_missing_to_do_this\", _x];" !"systemChat (localize " !"systemChat format[localize \"STR_EPOCH_" !"systemChat localize \"STR_EPOCH_" !"case \"system\": {systemChat _message;};" !"systemchat localize \"STR_CRAFTING_NEEDED_ITEMS\";" +5 systemChat !="systemChat format[localize \"str_missing_to_do_this\", _x];" !"systemChat (localize " !"systemChat format[localize \"STR_EPOCH_" !"systemChat localize \"STR_EPOCH_" !"case \"system\": {systemChat _message;};" !"systemchat localize \"STR_CRAFTING_NEEDED_ITEMS\";" !"systemChat format[localize \"STR_CL_" !"systemChat localize \"STR_CL_" 5 title !"titleCut [\"\", \"BLACK " !"\"titleCut\", " !"\"titleText\"" !="rtitleCut = 'titleCut'" !"rtitleCutc" !="rtitleText = 'titleText'" !"rtitleTextc" !"(_missionTextListPath >> \"titles\")" !"(_display displayCtrl _titleIDC) ctrlShow false;" !"titleText [format[localize \"str_return_lobby\", _x" !",\"_titleText\"" !"localize 'STR_UI_GENDER_TITLE';\n_timeNem" !="scriptName \"MP\\data\\scriptCommands\\titleText.sqf\";" !_fillTradeTitle !_bldTxtStringTitle !"localize \"str_halo_altitude_speed" 5 toString !"_animCheck = toString ([(_animStateArray select 0),(_animStateArray select 1)" !="_skinToModel = toString (_finalArray);" !="{_textArrayTemp = _textArrayTemp + [tostring [_x]]} foreach _line;" !="_cmpt = toString _cmpt;" !="_objName = toLower(toString(_objName));" !"if (toString _hayArr != _needle) then {" !="_type = toString _typeA;" !="_anim4 = toString _anim4;" !"{(count _stance>17)}) then {toString [_stance select 17]}" !"BIS_fnc_timeToString" !"02, if (typeName _name == \"ARRAY\") then {toString _name} else {_name}];" !="s = true;\n\n_array = toArray (animationState player);\n_str = toString [_array select 5,_array select 6,_array select 7];\n_anim = " 5 worldTo !="_relPos = _building worldToModel _point;" !"_w2m = _x worldToModel (getPosATL player);\n_bb = (boundingbox _x) select 1;" !="_h = _offset + ((_o worldToModel (getPosATL _o)) select 2);" !"_pos set [2,(_pos select 2) + 1.5];\n_screen = worldToScreen _pos;\n_text = composeText [image" !="\n_pos = _this select 1; \n_offset = 1; \n\n_relPos = _building worldToModel _pos;\n_boundingBox = boundingBox _building;\n\n_min = _bo"