itsatrap Posted August 31, 2014 Report Share Posted August 31, 2014 Hi all Worked on this problem most of weekend and have found a solution that requires little change in the code copy this files from the dayz_code player_unlockDoor.sqf and player_changeCombo.sqf and place them in your mission file. folder dayz_code\compile\ in your compiles.sqf add player_unlockDoor = compile preprocessFileLineNumbers "dayz_code\compile\player_unlockDoor.sqf"; player_changeCombo = compile preprocessFileLineNumbers "dayz_code\compile\player_changeCombo.sqf"; FILE: player_unlockDoor.sqf inset this code DZE_Lock_Door = CGG_Lock_Door; under _objectCharacterID = _obj getVariable ["CharacterID","0"]; should look like this _objectCharacterID = _obj getVariable ["CharacterID","0"]; DZE_Lock_Door = CGG_Lock_Door; at the bottom add this code as the second last line CGG_Lock_Door = "0"; DZE_DYN_UnlockDoorInprogress = nil; FILE: player_changeCombo.sqf replace this code: last line in file //DZE_Lock_Door = format["%1%2%3",DZE_topCombo,DZE_midCombo,DZE_botCombo]; CGG_Lock_Door = format["%1%2%3",DZE_topCombo,DZE_midCombo,DZE_botCombo]; Link to comment Share on other sites More sharing options...
StiflersM0M Posted August 31, 2014 Report Share Posted August 31, 2014 can you descripe the exact bug ? cant imagine what you mean :p Link to comment Share on other sites More sharing options...
itsatrap Posted August 31, 2014 Author Report Share Posted August 31, 2014 when you open the door combolook gui, you can set the code of the door, press ESC you can now unlock the door with having pressed the unlock button in the GUI, which means you have infinity attempts so a player can use a macro to unlock, had one on my server do it, he found the door key in 4 min, and the key was 487.. Link to comment Share on other sites More sharing options...
ToejaM Posted August 31, 2014 Report Share Posted August 31, 2014 I use this to prevent brute forcing but it doesnt work with your fix. if (!isDedicated) then { player_unlockDoor = { private ["_ok"]; if (!isNull dayz_selectedDoor) then { _obj = dayz_selectedDoor; _objectCharacterID = _obj getVariable ["CharacterID","0"]; if (DZE_Lock_Door == _objectCharacterID) then { [player,"combo_unlock",0,false] call dayz_zombieSpeak; disableSerialization; _display = findDisplay 41144; _display closeDisplay 3000; if(_obj animationPhase "Open_hinge" == 0) then { _obj animate ["Open_hinge", 1]; }; if(_obj animationPhase "Open_latch" == 0) then { _obj animate ["Open_latch", 1]; }; } else { DZE_Lock_Door = ""; [player,"combo_locked",0,false] call dayz_zombieSpeak; disableSerialization; _display = findDisplay 41144; _display closeDisplay 3000; cutText ["WRONG CODE ENTERED - WAIT 30 SECONDS", "PLAIN DOWN"]; if (isNil 'KeyCodeTry') then {KeyCodeTry = true;}; [] spawn {sleep 30;KeyCodeTry = nil;}; [] spawn { while {KeyCodeTry} do { disableSerialization; _display = findDisplay 41144; _display closeDisplay 3000; sleep 0.1; }; }; }; } else { disableSerialization; _display = findDisplay 41144; _display closeDisplay 3000; }; }; }; I'm trying a few things but while I do maybe you know how to make it work with this? As I get wrong code entered when I try it with your fix. Edit: This works: if (!isDedicated) then { player_unlockDoor = { private ["_ok"]; if (!isNull dayz_selectedDoor) then { _obj = dayz_selectedDoor; _objectCharacterID = _obj getVariable ["CharacterID","0"]; DZE_Lock_Door = CGG_Lock_Door; if (DZE_Lock_Door == _objectCharacterID) then { [player,"combo_unlock",0,false] call dayz_zombieSpeak; disableSerialization; _display = findDisplay 41144; _display closeDisplay 3000; if(_obj animationPhase "Open_hinge" == 0) then { _obj animate ["Open_hinge", 1]; }; if(_obj animationPhase "Open_latch" == 0) then { _obj animate ["Open_latch", 1]; }; } else { DZE_Lock_Door = ""; [player,"combo_locked",0,false] call dayz_zombieSpeak; disableSerialization; _display = findDisplay 41144; _display closeDisplay 3000; cutText ["WRONG CODE ENTERED - WAIT 30 SECONDS", "PLAIN DOWN"]; if (isNil 'KeyCodeTry') then {KeyCodeTry = true;}; [] spawn {sleep 30;KeyCodeTry = nil;}; [] spawn { while {KeyCodeTry} do { disableSerialization; _display = findDisplay 41144; _display closeDisplay 3000; sleep 0.1; }; }; }; } else { disableSerialization; _display = findDisplay 41144; _display closeDisplay 3000; }; }; }; ReDBaroN 1 Link to comment Share on other sites More sharing options...
itsatrap Posted August 31, 2014 Author Report Share Posted August 31, 2014 well the problem with this bug is that the player don't run player_unlockDoor.sqf which means all your anti macro don't work Link to comment Share on other sites More sharing options...
ToejaM Posted August 31, 2014 Report Share Posted August 31, 2014 No no, I followed your tutorial and mine is ontop of this. With a minor change its now fixed see above ^^ Link to comment Share on other sites More sharing options...
itsatrap Posted August 31, 2014 Author Report Share Posted August 31, 2014 Ahh you dont ude the sqf files from dayz_code you just add the funktion in your complies.sqf? And Well yes it works you put the code where it should go Link to comment Share on other sites More sharing options...
StiflersM0M Posted September 2, 2014 Report Share Posted September 2, 2014 I use this to prevent brute forcing but it doesnt work with your fix. if (!isDedicated) then { player_unlockDoor = { private ["_ok"]; if (!isNull dayz_selectedDoor) then { _obj = dayz_selectedDoor; _objectCharacterID = _obj getVariable ["CharacterID","0"]; if (DZE_Lock_Door == _objectCharacterID) then { [player,"combo_unlock",0,false] call dayz_zombieSpeak; disableSerialization; _display = findDisplay 41144; _display closeDisplay 3000; if(_obj animationPhase "Open_hinge" == 0) then { _obj animate ["Open_hinge", 1]; }; if(_obj animationPhase "Open_latch" == 0) then { _obj animate ["Open_latch", 1]; }; } else { DZE_Lock_Door = ""; [player,"combo_locked",0,false] call dayz_zombieSpeak; disableSerialization; _display = findDisplay 41144; _display closeDisplay 3000; cutText ["WRONG CODE ENTERED - WAIT 30 SECONDS", "PLAIN DOWN"]; if (isNil 'KeyCodeTry') then {KeyCodeTry = true;}; [] spawn {sleep 30;KeyCodeTry = nil;}; [] spawn { while {KeyCodeTry} do { disableSerialization; _display = findDisplay 41144; _display closeDisplay 3000; sleep 0.1; }; }; }; } else { disableSerialization; _display = findDisplay 41144; _display closeDisplay 3000; }; }; }; I'm trying a few things but while I do maybe you know how to make it work with this? As I get wrong code entered when I try it with your fix. Edit: This works: if (!isDedicated) then { player_unlockDoor = { private ["_ok"]; if (!isNull dayz_selectedDoor) then { _obj = dayz_selectedDoor; _objectCharacterID = _obj getVariable ["CharacterID","0"]; DZE_Lock_Door = CGG_Lock_Door; if (DZE_Lock_Door == _objectCharacterID) then { [player,"combo_unlock",0,false] call dayz_zombieSpeak; disableSerialization; _display = findDisplay 41144; _display closeDisplay 3000; if(_obj animationPhase "Open_hinge" == 0) then { _obj animate ["Open_hinge", 1]; }; if(_obj animationPhase "Open_latch" == 0) then { _obj animate ["Open_latch", 1]; }; } else { DZE_Lock_Door = ""; [player,"combo_locked",0,false] call dayz_zombieSpeak; disableSerialization; _display = findDisplay 41144; _display closeDisplay 3000; cutText ["WRONG CODE ENTERED - WAIT 30 SECONDS", "PLAIN DOWN"]; if (isNil 'KeyCodeTry') then {KeyCodeTry = true;}; [] spawn {sleep 30;KeyCodeTry = nil;}; [] spawn { while {KeyCodeTry} do { disableSerialization; _display = findDisplay 41144; _display closeDisplay 3000; sleep 0.1; }; }; }; } else { disableSerialization; _display = findDisplay 41144; _display closeDisplay 3000; }; }; }; so i just need to add these code in the compiles or what ? Link to comment Share on other sites More sharing options...
itsatrap Posted September 2, 2014 Author Report Share Posted September 2, 2014 No se ny code at #1 Link to comment Share on other sites More sharing options...
Soul Posted September 2, 2014 Report Share Posted September 2, 2014 Fix: characterID is a string not an integer. Find: CGG_Lock_Door = 0; Change 2: CGG_Lock_Door = "0"; anyway if you really want to block the escape button check my post out. Link to comment Share on other sites More sharing options...
itsatrap Posted September 2, 2014 Author Report Share Posted September 2, 2014 Fix: characterID is a string not an integer. Find: CGG_Lock_Door = 0; Change 2: CGG_Lock_Door = "0"; anyway if you really want to block the escape button check my post out. this line is only used to reset the varible. [] spawn { waitUntil takes more resources, thats why i was looking for an solution with no wait or spawn Link to comment Share on other sites More sharing options...
Soul Posted September 2, 2014 Report Share Posted September 2, 2014 this line is only used to reset the varible. [] spawn { waitUntil takes more resources, thats why i was looking for an solution with no wait or spawn not on your server and the sleep command in it slows it a bit down. been using this without problems over a year now. considering it is inside unsheduled environment it does not affect the overal processing time of all other code that needs to run constantly. _objectCharacterID = _obj getVariable ["CharacterID","0"]; DZE_Lock_Door = CGG_Lock_Door; if (DZE_Lock_Door == _objectCharacterID) then think about it, you setting your variable to an integer and that part checking for a string the result is a "Generic Error" However i found that it creates a bug that forces the player to go back to lobby and respawn to get the unlock door option again so this can go 2 ways... Link to comment Share on other sites More sharing options...
itsatrap Posted September 2, 2014 Author Report Share Posted September 2, 2014 No the csg_lock is set as string in the player_combolock then when a player pressing unlock it sets the dze_lock and I just used a 0 to reset it in the bottom Link to comment Share on other sites More sharing options...
ReDBaroN Posted November 20, 2014 Report Share Posted November 20, 2014 I use this to prevent brute forcing but it doesnt work with your fix. if (!isDedicated) then { player_unlockDoor = { private ["_ok"]; if (!isNull dayz_selectedDoor) then { _obj = dayz_selectedDoor; _objectCharacterID = _obj getVariable ["CharacterID","0"]; if (DZE_Lock_Door == _objectCharacterID) then { [player,"combo_unlock",0,false] call dayz_zombieSpeak; disableSerialization; _display = findDisplay 41144; _display closeDisplay 3000; if(_obj animationPhase "Open_hinge" == 0) then { _obj animate ["Open_hinge", 1]; }; if(_obj animationPhase "Open_latch" == 0) then { _obj animate ["Open_latch", 1]; }; } else { DZE_Lock_Door = ""; [player,"combo_locked",0,false] call dayz_zombieSpeak; disableSerialization; _display = findDisplay 41144; _display closeDisplay 3000; cutText ["WRONG CODE ENTERED - WAIT 30 SECONDS", "PLAIN DOWN"]; if (isNil 'KeyCodeTry') then {KeyCodeTry = true;}; [] spawn {sleep 30;KeyCodeTry = nil;}; [] spawn { while {KeyCodeTry} do { disableSerialization; _display = findDisplay 41144; _display closeDisplay 3000; sleep 0.1; }; }; }; } else { disableSerialization; _display = findDisplay 41144; _display closeDisplay 3000; }; }; }; I'm trying a few things but while I do maybe you know how to make it work with this? As I get wrong code entered when I try it with your fix. Edit: This works: if (!isDedicated) then { player_unlockDoor = { private ["_ok"]; if (!isNull dayz_selectedDoor) then { _obj = dayz_selectedDoor; _objectCharacterID = _obj getVariable ["CharacterID","0"]; DZE_Lock_Door = CGG_Lock_Door; if (DZE_Lock_Door == _objectCharacterID) then { [player,"combo_unlock",0,false] call dayz_zombieSpeak; disableSerialization; _display = findDisplay 41144; _display closeDisplay 3000; if(_obj animationPhase "Open_hinge" == 0) then { _obj animate ["Open_hinge", 1]; }; if(_obj animationPhase "Open_latch" == 0) then { _obj animate ["Open_latch", 1]; }; } else { DZE_Lock_Door = ""; [player,"combo_locked",0,false] call dayz_zombieSpeak; disableSerialization; _display = findDisplay 41144; _display closeDisplay 3000; cutText ["WRONG CODE ENTERED - WAIT 30 SECONDS", "PLAIN DOWN"]; if (isNil 'KeyCodeTry') then {KeyCodeTry = true;}; [] spawn {sleep 30;KeyCodeTry = nil;}; [] spawn { while {KeyCodeTry} do { disableSerialization; _display = findDisplay 41144; _display closeDisplay 3000; sleep 0.1; }; }; }; } else { disableSerialization; _display = findDisplay 41144; _display closeDisplay 3000; }; }; }; Hi chaps, like both your work here... :) Quick question, ToejaM, when I use your edited (2nd) version above with itsatrap's code merged in, I'm finding that if you enter the correct code, you have to click unlock 4 times before the lock dialog goes away and the open door option comes up on the scrollwheel....are you getting that too? Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now