LunchboxCharlie
Member
Well Andrew_S90 and I have been working on the base buildings to be brought into origins and we're about 85% done. We are hitting a snag with strongholds. As of right now, if you place a stronghold, it will supply a randomly generated code for an unlock. The person who built the structure can open and close it freely, however, a person when they place in the randomly generated code, will not unlock the structure. So we're at a bit if a snag. What are we missing here? This is the code we are using thus far (Andrew_S90 edited the safe unlock script from epoch):
s_unlock.sqf
s_open.sqf
Code:
if((typeOf cursorTarget == "krepost") && (player distance cursorTarget < 23)) then {
if (s_player_unlockstronghold < 0) then {
if((typeOf cursorTarget == "krepost") then {
if ((cursorTarget getVariable ["CharacterID","0"] == dayz_combination) or (cursorTarget getVariable ["CharacterID","0"] == dayz_playerUID)) then {
_sCombo = player addAction [format[ "Open %1",getText (configFile >> "CfgVehicles" >> typeOf cursorTarget >> "displayName")], "custom\build\stronghold\s_open.sqf",cursorTarget, 0, false, true];
s_player_str set [count s_player_str,_sCombo];
} else {
_sCombo = player addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "custom\build\stronghold\s_unlock.sqf",_cursorTarget, 0, false, true, "",""];
s_player_str set [count s_player_str,_sCombo];
};
s_player_unlockstronghold = 1;
} else {
if((cursorTarget getVariable ["CharacterID","0"] != dayz_combination) or (cursorTarget getVariable ["CharacterID","0"] != dayz_playerUID)) then {
_sCombo = player addAction [localize "STR_EPOCH_ACTIONS_RECOMBO", "custom\build\stronghold\s_unlock.sqf",_cursorTarget, 0, false, true, "",""];
s_player_str set [count s_player_str,_sCombo];
s_player_unlockstronghold = 1;
};
};
};
} else {
{player removeAction _x} count s_player_str;s_player_str = [];
player removeAction s_player_unlockstronghold;
s_player_unlockstronghold = -1;
player removeAction _sCombo;
_sCombo -1;
};
s_unlock.sqf
Code:
private ["_ok"];
if(DZE_ActionInProgress) exitWith { cutText [(localize "STR_EPOCH_PLAYER_21") , "PLAIN DOWN"]; };
DZE_ActionInProgress = true;
dayz_selectedVault = _this select 3;
dayz_combination = "";
if((typeOf cursorTarget == "krepost") and (player distance cursorTarget < 23)) then {
_ok = createdialog "SafeKeyPad";
} else {
_ok = createdialog "KeypadUI";
};
DZE_ActionInProgress = false;
s_open.sqf
Code:
// our target
_building = cursorTarget;
sleep 1;
titleText ["Opening..", "PLAIN DOWN"];
titleFadeOut 5;
_building say ["origins_door_heavy"];
_building animate ["vrata", 1];
_building animate ["hride1", 1];
_building animate ["kolo1", 1];
_building animate ["vaha", 1];
_building animate ["kolo2", 1];
Last edited: