Set custom Safe/Lockbox/Door codes when placed and allow changing of codes
-
Discussion URL: https://epochmod.com/forum/topic/45116-change-code-change-lockbox-safe-and-door-codes/
-
Tested as working on a blank Epoch 1.0.6.2 server
-
This will allow players to set the code on placement/upgrade of doors, lockboxes and safes as well as changing them after they are placed.
-
Please, if you report issues can you please attach (on pastebin or similar) your CLIENT rpt log file as this helps find out the errors very quickly. To find this logfile:
C:\users\<YOUR WINDOWS USERNAME>\AppData\Local\Arma 2 OA\ArmA2OA.RPT
- This install basically assumes you have NO custom variables.sqf or compiles.sqf or fn_selfActions.sqf, I would recommend diffmerging where possible.
-
In mission\init.sqf find:
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf";
and add directly below:call compile preprocessFileLineNumbers "dayz_code\init\variables.sqf";
-
In mission\init.sqf find:
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";
and add directly below:call compile preprocessFileLineNumbers "dayz_code\init\compiles.sqf";
-
Copy the
dayz_code
andscripts
folder from the repo to your mission folder. -
Download the
stringTable.xml
file linked below from the Community Localization GitHub and copy it to your mission folder, it is a community based localization file and contains translations for major community mods including this one.
>> Download stringTable.xml <<
-
Copy the
dayz_server\compile\server_changeCode.sqf
file from the repo to yourdayz_server\compile
folder -
In your
dayz_server\init\server_functions.sqf
file, find this line:spawn_vehicles = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\spawn_vehicles.sqf";
Add the following after it:
call compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_changeCode.sqf";
- In your
AH.sqf
remove this code block:if(!isNull (findDisplay 41144))then { _stateD = false; _stateV = false; if(isNil 'dayz_selectedDoor')then{_stateD = true;} else {if(isNull dayz_selectedDoor)then{_stateD = true;};}; if(isNil 'dayz_selectedVault')then{_stateV = true;} else {if(isNull dayz_selectedVault)then{_stateV = true;};}; if((_stateD) && (_stateV))then { (findDisplay 41144) closeDisplay 0; closeDialog 0;closeDialog 0;closeDialog 0; }; };
-
In your config<yourServerName>\Battleye\publicVariable.txt around line 2 find the line starting with:
5 !=(remExField|remExFP)
add this to the end of the line:!=SK_changeCode
So it will then look like this for example:
5 !=(remExField|remExFP) <CUT> !=SK_changeCode
-
In your config<yourServerName>\Battleye\scripts.txt around line 19 find the line starting with:
5 createDialog !="_region = createDialog "RscDisplaySpawnSelecter";"
add this to the end of the line:!"createDialog _dialog;\n\nwaitUntil {!dialog};\n\nif (keypadCancel) exitWith {"
So it will then look like this for example:
5 createDialog !="_region = createDialog \"RscDisplaySpawnSelecter\";" <CUT> !"createDialog _dialog;\n\nwaitUntil {!dialog};\n\nif (keypadCancel) exitWith {"
-
In your config<yourServerName>\Battleye\scripts.txt around line 72 find the line starting with:
5 systemChat !="systemChat format[localize "str_missing_to_do_this", _x];"
add this to the end of the line:!"systemChat format[localize \"STR_CL_" !"systemChat localize \"STR_CL_"
So it will then look like this for example:
5 systemChat !="systemChat format[localize \"str_missing_to_do_this\", _x];" <CUT> !"systemChat format[localize \"STR_CL_" !"systemChat localize \"STR_CL_"