SchwEde Posted May 21, 2015 Report Share Posted May 21, 2015 <==================== Schwedes Hotwire Lockboxes and Safes ====================> What it does? Gives player a chance to hotwire a Safe/Lockbox and steal everything inside. WARNING! For Admins without PP4L, once the safe/lockbox was cracked the player is allowed to pack the safe/lockbox and steal it too! As allways, do not expect noob friendly tutorials ;P What you need: fn_selfactions.sqf variables.sqf vault_hotwire.sqfStep 1vault_hotwire.sqf create a file named vault_hotwire.sqf with this content /** Author: SchwEde aka shinySonic **/ private ["_vault","_message","_isSafe","_isLockBox","_chanceSafe","_chanceLockbox"]; _vault = _this select 3; _chanceSafe = 5; //chance on Safe to succeed in % use only values between 0 - 100 _chanceLockbox = 10; //chance on Lockbox to succeed in % use only values between 0 - 100 player removeMagazine "ItemHotwireKit"; _isSafe = (typeOf _vault) == "VaultStorageLocked"; _isLockBox = (typeOf _vault) == "LockboxStorageLocked"; player removeAction s_player_hotwirevault; s_player_hotwirevault = -1; _failed = false; DZE_ActionInProgress = true; if (_isSafe) then { if ((random 10) >= (_chanceSafe/10)) exitWith { _failed = true; _message = ["Damn, i did not manage to hotwire this thing","Oh no! The Hotwire Kit was broken","Bad Luck, i could not open it and broke the Hotwire Kit"] call BIS_fnc_selectRandom; }; } else { if (_isLockBox) then { if ((random 10) >= (_chanceLockbox/10)) exitWith { _failed = true; _message = ["Damn, i did not manage to hotwire this thing","Oh no! The Hotwire Kit was broken","Bad Luck, i could not open it and broke the Hotwire Kit"] call BIS_fnc_selectRandom; }; } else { _failed = true; _message = ["Damn, i did not manage to hotwire this thing","Oh no! The Hotwire Kit was broken","Bad Luck, i could not open it and broke the Hotwire Kit"] call BIS_fnc_selectRandom; }; }; if (_failed) exitWith {cutText [_message, "PLAIN DOWN"];DZE_ActionInProgress = false;}; _message = ["I did it! Its should be open now","Got it. Now the vault is open","Done! I have opened the vault"] call BIS_fnc_selectRandom; cutText [_message, "PLAIN DOWN"]; dayz_combination = _vault getVariable["CharacterID","0"]; _vault spawn player_unlockVault; DZE_ActionInProgress = false; Place it somewhere in your mission folderStep 2:fn_selfaction add this (change the path to this file!) if(_hasHotwireKit) then { s_player_hotwirevault = player addaction [("<t color=""#B40404"">" + ("Hotwire Vault") +"</t>"), "Path_To\vault_hotwire.sqf",_cursorTarget, 0, false, true, "", ""]; }; above _combi = player addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true, "",""]; After: {player removeAction _x} count s_player_combi;s_player_combi = []; s_player_unlockvault = -1; add this: player removeAction s_player_hotwirevault; s_player_hotwirevault = -1; Same for the near bottom: this: player removeAction s_player_hotwirevault; s_player_hotwirevault = -1; before (or somewhere else in this section, its up to you) player removeAction s_player_forceSave; s_player_forceSave = -1; For PP4L Users to prevent stealing the Safe/Lockbox remove this code _characterID == dayz_combination || above this line 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, "",""]; Safe and doneStep 3:variables.sqf search for dayz_resetSelfActions = { and add this to this section s_player_hotwirevault = -1; Finish. Like my work? Spend me a beer or a cheesburger :) ElDubya, ryker, Tech_Support and 1 other 4 Link to comment Share on other sites More sharing options...
Millasaurus Posted May 21, 2015 Report Share Posted May 21, 2015 Should if ((random 10) >= (_chanceSafe/10)) exitWith { not be if ((random 10) <= (_chanceSafe/10)) exitWith { ? And the same for the lockboxes? Otherwise you're giving the player a 90 or 95% chance that they will break the safe. SchwEde 1 Link to comment Share on other sites More sharing options...
Gr8 Posted May 21, 2015 Report Share Posted May 21, 2015 Should if ((random 10) >= (_chanceSafe/10)) exitWith { not be if ((random 10) <= (_chanceSafe/10)) exitWith { ? And the same for the lockboxes? Otherwise you're giving the player a 90 or 95% chance that they will break the safe. That is the chance to fail. Read the code again Link to comment Share on other sites More sharing options...
Millasaurus Posted May 21, 2015 Report Share Posted May 21, 2015 That is the chance to fail. Read the code again if ((random 10) >= (_chanceSafe/10)) exitWith { When _chanceSafe/10 = 9.5, the code says for any random float from 9.5-10.0 it will fail. Meaning a float generated from 0-9.4 it will pass. Therefore it has a 94% pass rate. Should be the other way around. Link to comment Share on other sites More sharing options...
Linux Posted May 21, 2015 Report Share Posted May 21, 2015 Thank you, nice work! Link to comment Share on other sites More sharing options...
SchwEde Posted May 21, 2015 Author Report Share Posted May 21, 2015 Will check that tomorrow and see what's right there Link to comment Share on other sites More sharing options...
3steN8igall Posted May 22, 2015 Report Share Posted May 22, 2015 Should if ((random 10) >= (_chanceSafe/10)) exitWith { not be if ((random 10) <= (_chanceSafe/10)) exitWith { ? And the same for the lockboxes? Otherwise you're giving the player a 90 or 95% chance that they will break the safe. you are right. i have tested the original code and i can open every vault. i changed this _chanceSafe = 95; //chance on Safe to fail in % use only values between 0 - 100 _chanceLockbox = 90; //chance on Lockbox to fail in % use only values between 0 - 100 to this _chanceSafe = 5; //chance on Safe to fail in % use only values between 0 - 100 _chanceLockbox = 10; //chance on Lockbox to fail in % use only values between 0 - 100 and now i need ~15 attempts to open one safe SchwEde 1 Link to comment Share on other sites More sharing options...
SchwEde Posted May 22, 2015 Author Report Share Posted May 22, 2015 Thanks, first post has been updated :) Link to comment Share on other sites More sharing options...
ryker Posted May 28, 2015 Report Share Posted May 28, 2015 Nice, and again one of the more usefull scripts. Will definitely add this to our server! What do you think of adding a humanity-check which will affect the chance of failure/success. adding the option to open locked doors. Link to comment Share on other sites More sharing options...
SchwEde Posted May 28, 2015 Author Report Share Posted May 28, 2015 that's up to you, if you want just do some simple scripting and math and you should be good to go. For the Open Doors, well for me it's not logical to crack a lock like on the doors with a hotwirekit. But it's almost the same steps, so go ahead and make it ;) Link to comment Share on other sites More sharing options...
Shawn Posted February 1, 2016 Report Share Posted February 1, 2016 Hey man, loving what you made here! But I did find a bug which is a major issue. When one scrolls and gets the option to "hotwire vault", they can then quickly put the hotwire into their backpack, and the option is still there. This means that safes can be opened without using the hotwire. Essentially, all safes can be opened with 1 hotwire. Could you possibly make a fix for this? Thanks! Link to comment Share on other sites More sharing options...
Tech_Support Posted February 1, 2016 Report Share Posted February 1, 2016 On 5/28/2015 at 0:27 AM, SchwEde said: that's up to you, if you want just do some simple scripting and math and you should be good to go. For the Open Doors, well for me it's not logical to crack a lock like on the doors with a hotwirekit. But it's almost the same steps, so go ahead and make it ;) you should make it for Door locks players use a Crowbar To Open Doors players should use a sledge hammer For failed attempts remove Tool Item say hint you broke your tool would be nice to Raid Bases by busting the door lock then the door then with your hotwire kit rob the safe/lockbox Link to comment Share on other sites More sharing options...
creativv Posted February 3, 2016 Report Share Posted February 3, 2016 (edited) On 1-2-2016 at 10:51 AM, Shawn said: Hey man, loving what you made here! But I did find a bug which is a major issue. When one scrolls and gets the option to "hotwire vault", they can then quickly put the hotwire into their backpack, and the option is still there. This means that safes can be opened without using the hotwire. Essentially, all safes can be opened with 1 hotwire. Could you possibly make a fix for this? Thanks! Edited February 7, 2016 by creativv Shawn put the removeaction on the wrong spot :) Shawn 1 Link to comment Share on other sites More sharing options...
rpg4e Posted February 5, 2016 Report Share Posted February 5, 2016 For doors and garagedoors too? pleeeaaaseee :D Link to comment Share on other sites More sharing options...
creativv Posted February 7, 2016 Report Share Posted February 7, 2016 i have a code popping locks on doors but its not mine and i dont know the author unfortunially . So i am not allowed to post it i think there is no author that claimed it there is no name on it . Link to comment Share on other sites More sharing options...
Shawn Posted March 6, 2016 Report Share Posted March 6, 2016 There is a fix for the unlimited hotwire vault glitch if anyone wanted. /** Author: SchwEde aka shinySonic **/ /** Edited by Shawn **/ private ["_vault","_message","_isSafe","_isLockBox","_chanceSafe","_chanceLockbox","_mags"]; _vault = _this select 3; _chanceSafe = 5; //chance on Safe to succeed in % use only values between 0 - 100 _chanceLockbox = 10; //chance on Lockbox to succeed in % use only values between 0 - 100 if !("ItemHotwireKit" in magazines player) exitWith { cutText [format["No hotwire in inventory."],"PLAIN DOWN"]; _failed = true; DZE_ActionInProgress = false; }; player removeMagazine "ItemHotwireKit"; _isSafe = (typeOf _vault) == "VaultStorageLocked"; _isLockBox = (typeOf _vault) == "LockboxStorageLocked"; player removeAction s_player_hotwirevault; s_player_hotwirevault = -1; _failed = false; DZE_ActionInProgress = true; if (_isSafe) then { if ((random 10) >= (_chanceSafe/10)) exitWith { _failed = true; _message = ["Woops. Yep, I broke it.","Oh no! The Hotwire Kit broke!","Welp, can't get it open and broke it."] call BIS_fnc_selectRandom; }; } else { if (_isLockBox) then { if ((random 10) >= (_chanceLockbox/10)) exitWith { _failed = true; _message = ["Woops. Yep, I broke it.","Oh no! The Hotwire Kit broke!","Welp, can't get it open and broke it."] call BIS_fnc_selectRandom; }; } else { _failed = true; _message = ["Woops. Yep, I broke it.","Oh no! The Hotwire Kit broke!","Welp, can't get it open and broke it."] call BIS_fnc_selectRandom; }; }; if (_failed) exitWith {cutText [_message, "PLAIN DOWN"];DZE_ActionInProgress = false;}; _message = ["I did it! It should be open now.","Got it. Now the vault is open!","Done! I have opened the vault!"] call BIS_fnc_selectRandom; cutText [_message, "PLAIN DOWN"]; dayz_combination = _vault getVariable["CharacterID","0"]; _vault spawn player_unlockVault; DZE_ActionInProgress = false; AxeMan123 1 Link to comment Share on other sites More sharing options...
creativv Posted March 6, 2016 Report Share Posted March 6, 2016 11 hours ago, Shawn said: There is a fix for the unlimited hotwire vault glitch if anyone wanted. /** Author: SchwEde aka shinySonic **/ /** Edited by Shawn **/ private ["_vault","_message","_isSafe","_isLockBox","_chanceSafe","_chanceLockbox","_mags"]; _vault = _this select 3; _chanceSafe = 5; //chance on Safe to succeed in % use only values between 0 - 100 _chanceLockbox = 10; //chance on Lockbox to succeed in % use only values between 0 - 100 if !("ItemHotwireKit" in magazines player) exitWith { cutText [format["No hotwire in inventory."],"PLAIN DOWN"]; _failed = true; DZE_ActionInProgress = false; }; player removeMagazine "ItemHotwireKit"; _isSafe = (typeOf _vault) == "VaultStorageLocked"; _isLockBox = (typeOf _vault) == "LockboxStorageLocked"; player removeAction s_player_hotwirevault; s_player_hotwirevault = -1; _failed = false; DZE_ActionInProgress = true; if (_isSafe) then { if ((random 10) >= (_chanceSafe/10)) exitWith { _failed = true; _message = ["Woops. Yep, I broke it.","Oh no! The Hotwire Kit broke!","Welp, can't get it open and broke it."] call BIS_fnc_selectRandom; }; } else { if (_isLockBox) then { if ((random 10) >= (_chanceLockbox/10)) exitWith { _failed = true; _message = ["Woops. Yep, I broke it.","Oh no! The Hotwire Kit broke!","Welp, can't get it open and broke it."] call BIS_fnc_selectRandom; }; } else { _failed = true; _message = ["Woops. Yep, I broke it.","Oh no! The Hotwire Kit broke!","Welp, can't get it open and broke it."] call BIS_fnc_selectRandom; }; }; if (_failed) exitWith {cutText [_message, "PLAIN DOWN"];DZE_ActionInProgress = false;}; _message = ["I did it! It should be open now.","Got it. Now the vault is open!","Done! I have opened the vault!"] call BIS_fnc_selectRandom; cutText [_message, "PLAIN DOWN"]; dayz_combination = _vault getVariable["CharacterID","0"]; _vault spawn player_unlockVault; DZE_ActionInProgress = false; Not really needed i think you have a mistake in your fn_selfactions , there is already a check if the player has a _HotwireKit if not then player removeAction s_player_hotwirevault; Link to comment Share on other sites More sharing options...
Snowbell Posted June 12, 2017 Report Share Posted June 12, 2017 . Link to comment Share on other sites More sharing options...
oldmatechoc Posted June 13, 2017 Report Share Posted June 13, 2017 1 hour ago, Snowbell said: Hi there, I am unable to locate a hotwire kit at all when in my server, I cant even use infistar to spawn one in. There is also no hotwire kit in the traders. It seems as if my entire server doesnt know about the hotwire kit even though I am running the latest version of Epoch. ItemHotwireKit By default you wont find anywhere but on Zombies. (Military, Police, and Pilot Zombies). You must add them to your traders if you wish to buy and sell. BTW this is the old version of the script for Epoch 1051. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now