I've gone through the instructions so I don't think I've missed anything (they are a little scattered though).
Everything works fine except when it comes to vaults/safes.
After a user places a safe, he is able to "open locked safe", however when they try to go and lock the safe they are given the error:
"you cannot lock this safe, you do not know the combination"
It does not give me the option to "re-enter combination"
Also a user complained he couldn't lock the safe (owner) but I was able to re enter the code, and lock their safe (he was not given the option for re enter code)
Anyone can point me in the right direction?
Cheers,
*Edit*
I opted for the method outlined in post it worked perfectly.
This is how epoch does it by default. I don't want safe owners getting lazy and never having to remember their safe/lockbox codes.
I found a way to do it. Here is what I did:
Removed player_lockVault.sqf
Removed player_packVault.sqf
Removed player_unlockVault.sqf
In fn_selfActions.sqf I defined a new variable for _ownerID
_ownerID = _cursorTarget getVariable ["ownerPUID","0"];
_ownerID2 = _cursorTarget getVariable ["CharacterID","0"];
This new var uses CharacterID instead of ownerPUID.
Then for all the vault actions I used the new var:
//Allow owner to unlock vault
if((_typeOfCursorTarget in DZE_LockableStorage) && _ownerID2 != "0" && (player distance _cursorTarget < 3)) then {
if (s_player_unlockvault < 0) then {
if(_typeOfCursorTarget in DZE_LockedStorage) then {
if(_ownerID2 == dayz_combination || _ownerID2 == dayz_playerUID) then {
_combi = player addAction [format[localize "STR_EPOCH_ACTIONS_OPEN",_text], "\z\addons\dayz_code\actions\vault_unlock.sqf",_cursorTarget, 0, false, true, "",""];
s_player_combi set [count s_player_combi,_combi];
} else {
_combi = player addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true, "",""];
s_player_combi set [count s_player_combi,_combi];
};
s_player_unlockvault = 1;
} else {
if(_ownerID2 != dayz_combination && _ownerID2 != dayz_playerUID) then {
_combi = player addAction [localize "STR_EPOCH_ACTIONS_RECOMBO", "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true, "",""];
s_player_combi set [count s_player_combi,_combi];
s_player_unlockvault = 1;
};
};
};
} else {
{player removeAction _x} count s_player_combi;s_player_combi = [];
s_player_unlockvault = -1;
};
//Allow owner to pack vault
if(_typeOfCursorTarget in DZE_UnLockedStorage && _ownerID2 != "0" && (player distance _cursorTarget < 3)) then {
if (s_player_lockvault < 0) then {
if(_ownerID2 == dayz_combination || _ownerID2 == dayz_playerUID) then {
s_player_lockvault = player addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\vault_lock.sqf",_cursorTarget, 0, false, true, "",""];
};
};
if (s_player_packvault < 0 && (_ownerID2 == dayz_combination || _ownerID2 == dayz_playerUID)) then {
s_player_packvault = player addAction [format["<t color='#ff0000'>%1</t>",(format[localize "STR_EPOCH_ACTIONS_PACK",_text])], "\z\addons\dayz_code\actions\vault_pack.sqf",_cursorTarget, 0, false, true, "",""];
};
} else {
player removeAction s_player_packvault;
s_player_packvault = -1;
player removeAction s_player_lockvault;
s_player_lockvault = -1;
};
Now when someone dies, they are forced to re-enter the combination of the vault/lockbox.