Guest User

hotwireVault.sqf

a guest
Apr 22nd, 2018
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.65 KB | None | 0 0
  1. /** ORIGINAL Author: SchwEde aka shinySonic **/
  2. /** REWRITED BY juandayz and dedicated for Pillbox and NOVA :D **/
  3. //Fixes by "a man" and "shawn" tnks guys for the help
  4.  
  5. private ["_Message","_ownerID","_hasitem","_vault","_isunlockable","_open","_SetChanceToFail"];
  6.  
  7. _vault = _this select 3;
  8. _isunlockable = (((typeOf _vault) == "VaultStorageLocked") || ((typeOf _vault) == "LockboxStorageLocked"));
  9. _open= round(random 10);
  10. _SetChanceToFail = 9;//1 chance to unlock /9 chance to cannot unlock
  11. _hasitem = "ItemHotwireKit" in magazines player;
  12. _ownerID = cursorTarget getVariable ["ownerPUID","0"];
  13.  
  14. player removeAction s_player_hotwirevault;
  15. s_player_hotwirevault = -1;
  16.  
  17. if (!_hasitem) exitWith {
  18.     localize "STR_NEED_HOTWIRE_KIT" call dayz_rollingMessages;
  19. };
  20.  
  21. dayz_actionInProgress = true;
  22. player removeMagazine "ItemHotwireKit";
  23.  
  24. if (_isunlockable) then {
  25.     if (_open < _SetChanceToFail)  exitWith {
  26.         dayz_actionInProgress = false;
  27.         localize "STR_STILL_LOCKED" call dayz_rollingMessages;
  28.         _Message = format ["%1 (%2) IS TRYING TO BREAK INTO A SAFE OR LOCKBOX @ %3  Owner: %4",dayz_playerName,dayz_playerUID,(mapGridPosition getPos player),_ownerID];
  29.         ["CrackSafe_log",_Message,true] call fnc_log;                            
  30.     };
  31.  
  32.     localize "STR_UNLOCK_SUCCESS" call dayz_rollingMessages;
  33.  
  34.     dayz_combination = _vault getVariable["CharacterID","0"];
  35.     _vault spawn player_unlockVault;
  36.     dayz_actionInProgress = false;
  37.     _Message = format ["%1 (%2) HAS BROKEN INTO A SAFE OR LOCKBOX @ %3  Owner: %4",dayz_playerName,dayz_playerUID,(mapGridPosition getPos player),_ownerID];
  38.     ["CrackSafe_log",_Message,true] call fnc_log;                            
  39. };
Advertisement
Add Comment
Please, Sign In to add comment