Jump to content
  • 0

script issues


jeremyleborgne39350@hotmai

Question

2 answers to this question

Recommended Posts

  • 0

1. Place in your fn_selfActions.sqf above //Allow owner to pack vault add this.

//--------------------- hotwire vault -------------------------------------
    if (_typeOfCursorTarget in DZE_LockableStorage) then {    
        if (s_player_hotwirevault < 0) then {                      
            s_player_hotwirevault = player addaction [("<t color=""#B40404"">" + ("Crack Safe") +"</t>"), "Scripts\forcevault.sqf",_cursorTarget, 0, false, true, "", ""];
        };                   
    } else {
        player removeAction s_player_hotwirevault;
        s_player_hotwirevault = -1;
    };    
    if (_typeOfCursorTarget in DZE_UnLockedStorage) then {
        player removeAction s_player_hotwirevault;
        s_player_hotwirevault = -1;
    };
    //------------------------------------

2. In your variables at the bottom of dayz_resetSelfActions = {

s_player_hotwirevault = -1;

3. make a sqf called forcevault.sqf add this and place into your scripts folder.

//----------------------------------------------------------------
/** ORIGINAL Author: SchwEde aka shinySonic **/
/** REWRITED BY juandayz and dedicated for Pillbox and NOVA :D **/
//----------------------------------------------------------------
//Fixes by "a man" and "shawn" thanks guys for the help
//----------------------------------------------------------------

private ["_Message","_ownerID","_hasitem","_vault","_isunlockable","_open","_SetChanceToFail"];

_vault = _this select 3;
_isunlockable = (((typeOf _vault) == "VaultStorageLocked") || ((typeOf _vault) == "LockboxStorageLocked"));
_open= round(random 10);
_SetChanceToFail = 4;//1 chance to unlock /9 chance to cannot unlock
_hasitem = "ItemHotwireKit" in magazines player;
_ownerID = cursorTarget getVariable ["ownerPUID","0"];

player removeAction s_player_hotwirevault;
s_player_hotwirevault = -1;

if (!_hasitem) exitWith {
    systemChat("You need a hotwire kit in your inventory");
};

dayz_actionInProgress = true;
player removeMagazine "ItemHotwireKit";

if (_isunlockable) then {

    if (_open < _SetChanceToFail)  exitWith {
        dayz_actionInProgress = false;
        systemChat("Bad Luck, i could not open it and broke the Hotwire Kit");
        _Message = format ["%1 (%2) IS TRYING TO BREAK INTO A SAFE OR LOCKBOX @ %3  Owner: %4",dayz_playerName,dayz_playerUID,(mapGridPosition getPos player),_ownerID];
        ["CrackSafe_log",_Message,true] call fnc_log;                            
    };
    systemChat("Done! The safe has been cracked");
    dayz_combination = _vault getVariable["CharacterID","0"];
    _vault spawn player_unlockVault;
    dayz_actionInProgress = false;
    _Message = format ["%1 (%2) HAS BROKEN INTO A SAFE OR LOCKBOX @ %3  Owner: %4",dayz_playerName,dayz_playerUID,(mapGridPosition getPos player),_ownerID];
    ["CrackSafe_log",_Message,true] call fnc_log;                             
    };
};

 

Tested and working on my server currently! :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...