Jump to content
  • 0
Sign in to follow this  
jeremyleborgne39350@hotmai

script issues

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! :)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...