DirtySanchez Posted April 6, 2015 Report Share Posted April 6, 2015 Can confirm vehicle unlock even if successful in the script fails to unlock vehicles. Also added a 10 Oz gold bar to the equation and it's still only necessary to have the base two required. looks great so far just a few more kinks to work out. Thanks. Link to comment Share on other sites More sharing options...
second_coming Posted April 7, 2015 Author Report Share Posted April 7, 2015 Can confirm vehicle unlock even if successful in the script fails to unlock vehicles. Also added a 10 Oz gold bar to the equation and it's still only necessary to have the base two required. looks great so far just a few more kinks to work out. Thanks. It must be an infiSTAR config thing as it does work on my server (I watched a few people do it on the live server last night). Link to comment Share on other sites More sharing options...
TPwalker Posted April 7, 2015 Report Share Posted April 7, 2015 I will test more, I completely removed infistar from the server and tested and it worked the exact same way. says succesful on a vehicle but doesnt unlock... Link to comment Share on other sites More sharing options...
ISupervisoRI Posted April 8, 2015 Report Share Posted April 8, 2015 Hi, yeah i think its an infiSTAR issue. I installed it yesterday on my Testserver and it worked like TPwalker says (says succesful but not unlocking vehicle) just wrote Chris (infiSTAR) an email and now waiting for his response. Link to comment Share on other sites More sharing options...
TPwalker Posted April 8, 2015 Report Share Posted April 8, 2015 Hi, yeah i think its an infiSTAR issue. I installed it yesterday on my Testserver and it worked like TPwalker says (says succesful but not unlocking vehicle) just wrote Chris (infiSTAR) an email and now waiting for his response. I removed infistar from my test server and tried it again but i had no luck still..... I want this to work lol only solution out there to the crappy lock system they have going. Link to comment Share on other sites More sharing options...
second_coming Posted April 8, 2015 Author Report Share Posted April 8, 2015 Try re-downloading the file again, I've just updated it. Just noticed a noob error. I was calling the wrong function to unlock the vehicles. Sorry folks! (this is now the link in the initial download also): https://www.dropbox.com/s/fckqubg2mvw21r1/AutoLockPicker.rar?dl=0 (If you already have it installed you just need to use the updated a3_epoch_autolockpicker.pbo that is the only thing that's changed.) Link to comment Share on other sites More sharing options...
1Man Posted April 8, 2015 Report Share Posted April 8, 2015 This is configurable to only unlock vehicles? I would only want it to unlock vehicles which is why I ask, I assume I just removed the doors from the script? Link to comment Share on other sites More sharing options...
second_coming Posted April 8, 2015 Author Report Share Posted April 8, 2015 This is configurable to only unlock vehicles? I would only want it to unlock vehicles which is why I ask, I assume I just removed the doors from the script? If you only want to to work with vehicles just edit the script AutoLockPicker.sqf or just cut and paste this :) /* Stealthstick's "Explosive-To-Vehicle" Script modified by second_coming (http://epochmod.com/forum/index.php?/user/16619-second-coming/) with help from SpiRe to allow players to have a 25% chance to lock pick any vehicle or locked door (also a 10% chance to eloctrocute!) Electrocution effect from: http://www.altisliferpg.com/topic/224-effects-on-marijuana-use/ */ AutoLockPicker_MatsCheck = { _charge1 = _this select 0; _charge2 = _this select 1; _unit = _this select 2; _hasIt1 = _charge1 in (magazines _unit); _hasIt2 = _charge2 in (magazines _unit); _nearVehs = nearestObjects [_unit,["Air","Ship","LandVehicle"],5]; _return = (_hasIt1 && _hasIt2 && count _nearVehs > 0 && alive _unit); _return }; AutoLockPicker_Activate = { _array = _this select 3; _unit = _array select 0; _lockpicks = _unit getVariable ["lockpicks",[]]; { if(alive _x) then { // Chance to unlock _chance = Ceil random 100; if(_chance <= 20) then{ // Unlock the door or vehicle _nearVehicle = (nearestObjects [_x,["Air","Ship","LandVehicle"],5]) select 0; deleteVehicle _x; ALPUNLOCK = [_nearVehicle]; sleep 3; publicVariableServer "ALPUNLOCK"; sleep 1; hint "The AutoLockPicker worked! Unlocking Vehicle"; } else { _chance2 = Ceil random 100; if(_chance2 <= 10) then{ // Chance of electrocution _chance3 = (Ceil random 40)/100; _damage = Damage player; _damage = _damage + 0.5 + _chance3; playSound "shocker"; if(_damage > 1 ) then { hint "The AutoLockPicker malfunctioned and electrocuted you"; // Activate ppEffects "chromAberration" ppEffectEnable true; "radialBlur" ppEffectEnable true; enableCamShake true; // 5secs of effects for "_i" from 0 to 4 do { "chromAberration" ppEffectAdjust [random 0.25,random 0.25,true]; "chromAberration" ppEffectCommit 1; "radialBlur" ppEffectAdjust [random 0.02,random 0.02,0.15,0.15]; "radialBlur" ppEffectCommit 1; addcamShake[random 3, 1, random 3]; sleep 1; }; //Stop effects "chromAberration" ppEffectAdjust [0,0,true]; "chromAberration" ppEffectCommit 5; "radialBlur" ppEffectAdjust [0,0,0,0]; "radialBlur" ppEffectCommit 5; sleep 6; //Deactivate ppEffects "chromAberration" ppEffectEnable false; "radialBlur" ppEffectEnable false; resetCamShake; player setDamage 1; } else { hint "The AutoLockPicker malfunctioned and gave you an electric shock"; player setDamage _damage; player playMove "amovpknlmstpsraswrfldnon"; // Activate ppEffects "chromAberration" ppEffectEnable true; "radialBlur" ppEffectEnable true; enableCamShake true; // 5secs of effects for "_i" from 0 to 4 do { "chromAberration" ppEffectAdjust [random 0.25,random 0.25,true]; "chromAberration" ppEffectCommit 1; "radialBlur" ppEffectAdjust [random 0.02,random 0.02,0.15,0.15]; "radialBlur" ppEffectCommit 1; addcamShake[random 3, 1, random 3]; sleep 1; }; //Stop effects "chromAberration" ppEffectAdjust [0,0,true]; "chromAberration" ppEffectCommit 5; "radialBlur" ppEffectAdjust [0,0,0,0]; "radialBlur" ppEffectCommit 5; sleep 6; //Deactivate ppEffects "chromAberration" ppEffectEnable false; "radialBlur" ppEffectEnable false; resetCamShake; }; deleteVehicle _x; } else{ hint "The AutoLockPicker failed to unlock the door, try again"; deleteVehicle _x; } }; }; } forEach _lockpicks; _unit setVariable ["lockpicks",[]]; }; AutoLockPicker_UnitCheck = { private "_return"; _unit = _this select 0; _lockpicks = _unit getVariable ["lockpicks",[]]; if(count _lockpicks > 0) then { _return = true; } else { _return = false; }; _return }; AutoLockPicker_AttachALP = { _array = _this select 3; _charge = _array select 0; _unit = _array select 1; private "_class"; _unit removeMagazine 'CircuitParts'; _unit removeMagazine 'ItemCorrugated'; _unit playMove "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon"; switch _charge do { case "Land_PortableLongRangeRadio_F": { _class = "Land_PortableLongRangeRadio_F"; }; }; _nearVehicle = (nearestObjects [_unit,["Air","Ship","LandVehicle"],5]) select 0; _autolockpick = _class createVehicle [0,0,0]; _autolockpick attachTo [_unit,[0,0,0],"leftHand"]; _random0 = random 180; _random1 = random 180; [_autolockpick,_random0,_random1] call BIS_fnc_SetPitchBank; [_autolockpick,_nearVehicle,_unit,_random0,_random1] spawn { _autolockpick = _this select 0; _nearVehicle = _this select 1; _unit = _this select 2; _random0 = _this select 3; _random1 = _this select 4; sleep 1.5; _autolockpick attachTo [_nearVehicle, [0,0,0.2]]; [_autolockpick,_random0,_random1] call BIS_fnc_SetPitchBank; _unit setVariable ["lockpicks",(_unit getVariable ["lockpicks",[]]) + [_autolockpick]]; }; }; AutoLockPicker_Actions = { private ["_unit"]; _unit = _this select 0; _unit addAction ["<t color=""#0099FF"">" +"Attach AutoLockPicker", AutoLockPicker_AttachALP, ["Land_PortableLongRangeRadio_F",_unit], 1, true, true, "","['CircuitParts','ItemCorrugated',_target] call AutoLockPicker_MatsCheck"]; _unit addAction ["<t color=""#3D993D"">" +"Activate AutoLockPicker", AutoLockPicker_Activate, [_unit], 1, true, true, "","[_target] call AutoLockPicker_UnitCheck"]; }; //======================= [player] call AutoLockPicker_Actions; Link to comment Share on other sites More sharing options...
TPwalker Posted April 8, 2015 Report Share Posted April 8, 2015 Try re-downloading the file again, I've just updated it. Just noticed a noob error. I was calling the wrong function to unlock the vehicles. Sorry folks! (this is now the link in the initial download also): https://www.dropbox.com/s/fckqubg2mvw21r1/AutoLockPicker.rar?dl=0 (If you already have it installed you just need to use the updated a3_epoch_autolockpicker.pbo that is the only thing that's changed.) Awesome!, Just tested and it works now... Good Work! Link to comment Share on other sites More sharing options...
Knatte_Anka Posted April 9, 2015 Report Share Posted April 9, 2015 Nice script:D Some of things I wondering about it though. Can the electrocution be changed from dammage to stunned and cant move for 1-2min?(maybe settings to set type or both at the same time and configuration how much min max of each dammage type) And can unlock of lockbox be added? Knatte_Anka 1 Link to comment Share on other sites More sharing options...
second_coming Posted April 9, 2015 Author Report Share Posted April 9, 2015 Nice script:D Some of things I wondering about it though. Can the electrocution be changed from dammage to stunned and cant move for 1-2min?(maybe settings to set type or both at the same time and configuration how much min max of each dammage type) And can unlock of lockbox be added? I'll have a look :) Link to comment Share on other sites More sharing options...
second_coming Posted April 10, 2015 Author Report Share Posted April 10, 2015 Updated the original download to include the new updated script which has server configurable variables (including the control over whether the electric shock causes damage or not): /* Stealthstick's "Explosive-To-Vehicle" Script modified by second_coming (http://epochmod.com/forum/index.php?/user/16619-second-coming/) with help from SpiRe to allow players to have a 25% chance to lock pick any vehicle or locked door (also a 10% chance to eloctrocute!) Electrocution effect from: http://www.altisliferpg.com/topic/224-effects-on-marijuana-use/ */ // ====================================================================================================================================================================================== // User configurable Variable // ====================================================================================================================================================================================== _LockpickLandVehicles = true; // All land vehicles (cars, vans, trucks etc) ::: acceptable values true or false _LockpickAir = true; // Helis and jets ::: acceptable values true or false _LockpickShip = true; // Boats, jetskis and submarines ::: acceptable values true or false _LockpickEpochDoors = true; // Epoch build-able doors ::: acceptable values true or false SuccessChance = 20; // (Between 1-100) % Chance to successfully pick the lock ElectrocuteChance = 10; // (Between 1-100) % Chance of electrocution on if the lock pick fails InflictDamage = true; // If true damage is added, if false just stun MinimumDamage = 50; // (Between 1-100) min% of full health Damage to inflict must be less than MaximumDamage MaximumDamage = 90; // (Between 1-100) max% of full health Damage to inflict must be more than MinimumDamage StunTime = 15; // Time in seconds to stun the player on electrocution (if it doesn't kill them) AllowInSafeZone = true; // (Leave true if you don't use inSafezone) Allow use of AutoLockPicker in safezones (using the boolean variable inSafezone set here http://epochmod.com/forum/index.php?/topic/32555-extended-safezone-script-working/) // ====================================================================================================================================================================================== if(AllowInSafeZone) then { SafeToALP = true; } else { if(!inSafezone ) then { SafeToALP = true; } else { SafeToALP = false; }; }; LockPickableItems = []; if(_LockpickLandVehicles) then { LockPickableItems = LockPickableItems + ["LandVehicle"]; }; if(_LockpickAir) then { LockPickableItems = LockPickableItems + ["Air"]; }; if(_LockpickShip) then { LockPickableItems = LockPickableItems + ["Ship"]; }; if(_LockpickEpochDoors) then { LockPickableItems = LockPickableItems + ["CinderWallGarage_EPOCH","WoodLargeWallDoorL_EPOCH","WoodLargeWallDoor_EPOCH"]; }; AutoLockPicker_MatsCheck = { _charge1 = _this select 0; _charge2 = _this select 1; _unit = _this select 2; _hasIt1 = _charge1 in (magazines _unit); _hasIt2 = _charge2 in (magazines _unit); _nearVehs = nearestObjects [_unit,LockPickableItems,5]; _return = (_hasIt1 && _hasIt2 && count _nearVehs > 0 && alive _unit && SafeToALP); _return }; AutoLockPicker_Activate = { _array = _this select 3; _unit = _array select 0; _lockpicks = _unit getVariable ["lockpicks",[]]; { if(alive _x && SafeToALP) then { // Chance to unlock _chance = Ceil random 100; if(_chance <= SuccessChance) then{ // Unlock the door or vehicle _nearVehicle = (nearestObjects [_x,LockPickableItems,5]) select 0; deleteVehicle _x; ALPUNLOCK = [_nearVehicle]; sleep 3; publicVariableServer "ALPUNLOCK"; sleep 1; if ((typeOf _nearVehicle) in ["CinderWallGarage_EPOCH","WoodLargeWallDoorL_EPOCH","WoodLargeWallDoor_EPOCH"]) then { hint "The AutoLockPicker worked! Opening door"; _nearVehicle animate ['open_left', 1]; _nearVehicle animate ['open_right', 1]; _nearVehicle animate ['Open_Door', 1]; } else { hint "The AutoLockPicker worked! Unlocking Vehicle"; } } else { _chance2 = Ceil random 100; if(_chance2 <= ElectrocuteChance) then{ // Chance of electrocution _DamagetoInflict = (Ceil random (MaximumDamage - MinimumDamage))/100; _damage = Damage player; _damage = _damage + (MinimumDamage/100) + _DamagetoInflict; playSound "shocker"; if(_damage > 1 && InflictDamage) then { hint "The AutoLockPicker malfunctioned and electrocuted you"; // Activate ppEffects "chromAberration" ppEffectEnable true; "radialBlur" ppEffectEnable true; enableCamShake true; // 5secs of effects for "_i" from 0 to 4 do { "chromAberration" ppEffectAdjust [random 0.25,random 0.25,true]; "chromAberration" ppEffectCommit 1; "radialBlur" ppEffectAdjust [random 0.02,random 0.02,0.15,0.15]; "radialBlur" ppEffectCommit 1; addcamShake[random 3, 1, random 3]; sleep 1; }; //Stop effects "chromAberration" ppEffectAdjust [0,0,true]; "chromAberration" ppEffectCommit 5; "radialBlur" ppEffectAdjust [0,0,0,0]; "radialBlur" ppEffectCommit 5; sleep 6; //Deactivate ppEffects "chromAberration" ppEffectEnable false; "radialBlur" ppEffectEnable false; resetCamShake; player setDamage 1; } else { hint "The AutoLockPicker malfunctioned and gave you an electric shock"; if(InflictDamage) then { player setDamage _damage; }; player playMove "amovpknlmstpsraswrfldnon"; // Activate ppEffects "chromAberration" ppEffectEnable true; "radialBlur" ppEffectEnable true; enableCamShake true; Sleep 1; // Stop the player from moving while shocked player enablesimulation false; // StunTime seconds of effects for "_i" from 0 to StunTime do { "chromAberration" ppEffectAdjust [random 0.25,random 0.25,true]; "chromAberration" ppEffectCommit 1; "radialBlur" ppEffectAdjust [random 0.02,random 0.02,0.15,0.15]; "radialBlur" ppEffectCommit 1; addcamShake[random 3, 1, random 3]; sleep 1; }; player enablesimulation true; //Stop effects "chromAberration" ppEffectAdjust [0,0,true]; "chromAberration" ppEffectCommit 5; "radialBlur" ppEffectAdjust [0,0,0,0]; "radialBlur" ppEffectCommit 5; sleep 6; //Deactivate ppEffects "chromAberration" ppEffectEnable false; "radialBlur" ppEffectEnable false; resetCamShake; }; deleteVehicle _x; } else{ hint "The AutoLockPicker failed to unlock the door, try again"; deleteVehicle _x; } }; }; } forEach _lockpicks; _unit setVariable ["lockpicks",[]]; }; AutoLockPicker_UnitCheck = { private "_return"; _unit = _this select 0; _lockpicks = _unit getVariable ["lockpicks",[]]; if(count _lockpicks > 0) then { _return = true; } else { _return = false; }; _return }; AutoLockPicker_AttachALP = { _array = _this select 3; _charge = _array select 0; _unit = _array select 1; private "_class"; _unit removeMagazine 'CircuitParts'; _unit removeMagazine 'ItemCorrugated'; _unit playMove "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon"; switch _charge do { case "Land_PortableLongRangeRadio_F": { _class = "Land_PortableLongRangeRadio_F"; }; }; _nearVehicle = (nearestObjects [_unit,LockPickableItems,5]) select 0; _autolockpick = _class createVehicle [0,0,0]; _autolockpick attachTo [_unit,[0,0,0],"leftHand"]; _random0 = random 180; _random1 = random 180; [_autolockpick,_random0,_random1] call BIS_fnc_SetPitchBank; [_autolockpick,_nearVehicle,_unit,_random0,_random1] spawn { _autolockpick = _this select 0; _nearVehicle = _this select 1; _unit = _this select 2; _random0 = _this select 3; _random1 = _this select 4; sleep 1.5; _autolockpick attachTo [_nearVehicle, [0,0,0.2]]; [_autolockpick,_random0,_random1] call BIS_fnc_SetPitchBank; _unit setVariable ["lockpicks",(_unit getVariable ["lockpicks",[]]) + [_autolockpick]]; }; }; AutoLockPicker_Actions = { private ["_unit"]; _unit = _this select 0; _unit addAction ["<t color=""#0099FF"">" +"Attach AutoLockPicker", AutoLockPicker_AttachALP, ["Land_PortableLongRangeRadio_F",_unit], 1, true, true, "","['CircuitParts','ItemCorrugated',_target] call AutoLockPicker_MatsCheck"]; _unit addAction ["<t color=""#3D993D"">" +"Activate AutoLockPicker", AutoLockPicker_Activate, [_unit], 1, true, true, "","[_target] call AutoLockPicker_UnitCheck"]; }; //======================= [player] call AutoLockPicker_Actions; Link to comment Share on other sites More sharing options...
Knatte_Anka Posted April 10, 2015 Report Share Posted April 10, 2015 Fast update :-) and good work with settings only missing thing is if lockbox can be lockpicked but can understand if that is harder/not possible to do. Link to comment Share on other sites More sharing options...
redwulf301 Posted April 11, 2015 Report Share Posted April 11, 2015 got script restriction #47 in the rpt file there is everything okay 19:36:20 BattlEye Server: Script Log: #0 redwulf301 (f61125c59620a6e67dd09fade9fbabbe) - #47 ""radialBlur" ppEffectEnable false; 19:36:20 resetCamShake; 19:36:20 19:36:20 19:36:20 player setDamage 1; 19:36:20 } 19:36:20 else 19:36:20 { 19:36:20 hint "The AutoLockPicker malfunctioned and gave" 19:36:20 Player redwulf301 kicked off by BattlEye: Script Restriction #47 19:36:20 Player redwulf301 disconnected. 19:40:39 "ALP# AutoLockPicker function ready" 19:40:39 "ALP: Checking for mission file" 19:40:39 "Continuing to load Epoch" Link to comment Share on other sites More sharing options...
second_coming Posted April 11, 2015 Author Report Share Posted April 11, 2015 on line 48 (setDamage) add: !"player setdamage 1;" Link to comment Share on other sites More sharing options...
Tobias Solem Posted April 12, 2015 Report Share Posted April 12, 2015 Could you add a check for player count that makes it so this isn't used when the server is almost empty? Like a "playersNeeded"-variable for it to work, and take away the success chance if the player amount is not equal to or above this. Link to comment Share on other sites More sharing options...
second_coming Posted April 12, 2015 Author Report Share Posted April 12, 2015 Added in user config to set the minimum number of players required online to use the lockpick: Original download link updated to include this update https://www.dropbox.com/s/fckqubg2mvw21r1/AutoLockPicker.rar?dl=0 /* AutoLockPicker by second_coming (http://epochmod.com/forum/index.php?/user/16619-second-coming/) with help from SpiRe Allow players to have a chance to lock pick any vehicle or locked door (also a chance to eloctrocute on failed unlocking!) Initial Script Code: Stealthstick's "Explosive-To-Vehicle" Script Electrocution effect: http://www.altisliferpg.com/topic/224-effects-on-marijuana-use/ */ // ====================================================================================================================================================================================== // User configurable Variable // ====================================================================================================================================================================================== _LockpickLandVehicles = true; // All land vehicles (cars, vans, trucks etc) ::: acceptable values true or false _LockpickAir = true; // Helis and jets ::: acceptable values true or false _LockpickShip = true; // Boats, jetskis and submarines ::: acceptable values true or false _LockpickEpochDoors = true; // Epoch build-able doors ::: acceptable values true or false SuccessChance = 20; // (Between 1-100) % Chance to successfully pick the lock ElectrocuteChance = 10; // (Between 1-100) % Chance of electrocution on if the lock pick fails InflictDamage = true; // If true damage is added, if false just stun MinimumDamage = 50; // (Between 1-100) min% of full health Damage to inflict must be less than MaximumDamage MaximumDamage = 90; // (Between 1-100) max% of full health Damage to inflict must be more than MinimumDamage StunTime = 15; // Time in seconds to stun the player on electrocution (if it doesn't kill them) AllowInSafeZone = true; // (Leave true if you don't use inSafezone) Allow use of AutoLockPicker in safezones (using the boolean variable inSafezone set here http://epochmod.com/forum/index.php?/topic/32555-extended-safezone-script-working/) _MinimumPlayers = 0; // Number of players required online before the option to lock pick becomes available (set to 0 to always allow) // ====================================================================================================================================================================================== if(AllowInSafeZone && count playableUnits >= _MinimumPlayers) then { SafeToALP = true; } else { if(!inSafezone && count playableUnits >= _MinimumPlayers) then { SafeToALP = true; } else { SafeToALP = false; }; }; LockPickableItems = []; if(_LockpickLandVehicles) then { LockPickableItems = LockPickableItems + ["LandVehicle"]; }; if(_LockpickAir) then { LockPickableItems = LockPickableItems + ["Air"]; }; if(_LockpickShip) then { LockPickableItems = LockPickableItems + ["Ship"]; }; if(_LockpickEpochDoors) then { LockPickableItems = LockPickableItems + ["CinderWallGarage_EPOCH","WoodLargeWallDoorL_EPOCH","WoodLargeWallDoor_EPOCH"]; }; AutoLockPicker_MatsCheck = { _charge1 = _this select 0; _charge2 = _this select 1; _unit = _this select 2; _hasIt1 = _charge1 in (magazines _unit); _hasIt2 = _charge2 in (magazines _unit); _nearVehs = nearestObjects [_unit,LockPickableItems,5]; _return = (_hasIt1 && _hasIt2 && count _nearVehs > 0 && alive _unit && SafeToALP); _return }; AutoLockPicker_Activate = { _array = _this select 3; _unit = _array select 0; _lockpicks = _unit getVariable ["lockpicks",[]]; { if(alive _x && SafeToALP) then { // Chance to unlock _chance = Ceil random 100; if(_chance <= SuccessChance) then{ // Unlock the door or vehicle _nearVehicle = (nearestObjects [_x,LockPickableItems,5]) select 0; deleteVehicle _x; ALPUNLOCK = [_nearVehicle]; sleep 3; publicVariableServer "ALPUNLOCK"; sleep 1; if ((typeOf _nearVehicle) in ["CinderWallGarage_EPOCH","WoodLargeWallDoorL_EPOCH","WoodLargeWallDoor_EPOCH"]) then { hint "The AutoLockPicker worked! Opening door"; _nearVehicle animate ['open_left', 1]; _nearVehicle animate ['open_right', 1]; _nearVehicle animate ['Open_Door', 1]; } else { hint "The AutoLockPicker worked! Unlocking Vehicle"; } } else { _chance2 = Ceil random 100; if(_chance2 <= ElectrocuteChance) then{ // Chance of electrocution _DamagetoInflict = (Ceil random (MaximumDamage - MinimumDamage))/100; _damage = Damage player; _damage = _damage + (MinimumDamage/100) + _DamagetoInflict; playSound "shocker"; if(_damage > 1 && InflictDamage) then { hint "The AutoLockPicker malfunctioned and electrocuted you"; // Activate ppEffects "chromAberration" ppEffectEnable true; "radialBlur" ppEffectEnable true; enableCamShake true; // 5secs of effects for "_i" from 0 to 4 do { "chromAberration" ppEffectAdjust [random 0.25,random 0.25,true]; "chromAberration" ppEffectCommit 1; "radialBlur" ppEffectAdjust [random 0.02,random 0.02,0.15,0.15]; "radialBlur" ppEffectCommit 1; addcamShake[random 3, 1, random 3]; sleep 1; }; //Stop effects "chromAberration" ppEffectAdjust [0,0,true]; "chromAberration" ppEffectCommit 5; "radialBlur" ppEffectAdjust [0,0,0,0]; "radialBlur" ppEffectCommit 5; sleep 6; //Deactivate ppEffects "chromAberration" ppEffectEnable false; "radialBlur" ppEffectEnable false; resetCamShake; player setDamage 1; } else { hint "The AutoLockPicker malfunctioned and gave you an electric shock"; if(InflictDamage) then { player setDamage _damage; }; player playMove "amovpknlmstpsraswrfldnon"; // Activate ppEffects "chromAberration" ppEffectEnable true; "radialBlur" ppEffectEnable true; enableCamShake true; Sleep 1; // Stop the player from moving while shocked player enablesimulation false; // StunTime seconds of effects for "_i" from 0 to StunTime do { "chromAberration" ppEffectAdjust [random 0.25,random 0.25,true]; "chromAberration" ppEffectCommit 1; "radialBlur" ppEffectAdjust [random 0.02,random 0.02,0.15,0.15]; "radialBlur" ppEffectCommit 1; addcamShake[random 3, 1, random 3]; sleep 1; }; player enablesimulation true; //Stop effects "chromAberration" ppEffectAdjust [0,0,true]; "chromAberration" ppEffectCommit 5; "radialBlur" ppEffectAdjust [0,0,0,0]; "radialBlur" ppEffectCommit 5; sleep 6; //Deactivate ppEffects "chromAberration" ppEffectEnable false; "radialBlur" ppEffectEnable false; resetCamShake; }; deleteVehicle _x; } else{ hint "The AutoLockPicker failed to unlock the door, try again"; deleteVehicle _x; } }; }; } forEach _lockpicks; _unit setVariable ["lockpicks",[]]; }; AutoLockPicker_UnitCheck = { private "_return"; _unit = _this select 0; _lockpicks = _unit getVariable ["lockpicks",[]]; if(count _lockpicks > 0) then { _return = true; } else { _return = false; }; _return }; AutoLockPicker_AttachALP = { _array = _this select 3; _charge = _array select 0; _unit = _array select 1; private "_class"; _unit removeMagazine 'CircuitParts'; _unit removeMagazine 'ItemCorrugated'; _unit playMove "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon"; switch _charge do { case "Land_PortableLongRangeRadio_F": { _class = "Land_PortableLongRangeRadio_F"; }; }; _nearVehicle = (nearestObjects [_unit,LockPickableItems,5]) select 0; _autolockpick = _class createVehicle [0,0,0]; _autolockpick attachTo [_unit,[0,0,0],"leftHand"]; _random0 = random 180; _random1 = random 180; [_autolockpick,_random0,_random1] call BIS_fnc_SetPitchBank; [_autolockpick,_nearVehicle,_unit,_random0,_random1] spawn { _autolockpick = _this select 0; _nearVehicle = _this select 1; _unit = _this select 2; _random0 = _this select 3; _random1 = _this select 4; sleep 1.5; _autolockpick attachTo [_nearVehicle, [0,0,0.2]]; [_autolockpick,_random0,_random1] call BIS_fnc_SetPitchBank; _unit setVariable ["lockpicks",(_unit getVariable ["lockpicks",[]]) + [_autolockpick]]; }; }; AutoLockPicker_Actions = { private ["_unit"]; _unit = _this select 0; _unit addAction ["<t color=""#0099FF"">" +"Attach AutoLockPicker", AutoLockPicker_AttachALP, ["Land_PortableLongRangeRadio_F",_unit], 1, true, true, "","['CircuitParts','ItemCorrugated',_target] call AutoLockPicker_MatsCheck"]; _unit addAction ["<t color=""#3D993D"">" +"Activate AutoLockPicker", AutoLockPicker_Activate, [_unit], 1, true, true, "","[_target] call AutoLockPicker_UnitCheck"]; }; //======================= [player] call AutoLockPicker_Actions; Link to comment Share on other sites More sharing options...
second_coming Posted April 12, 2015 Author Report Share Posted April 12, 2015 Updated script, altered all Sleep commands to uiSleep. Link to comment Share on other sites More sharing options...
Tobias Solem Posted April 12, 2015 Report Share Posted April 12, 2015 Man. That was fast. :) - thank you. Something my players commented on is that when you have someone successfully being able to lockpick your door, there is no way to tell the difference between a legitimate breakin or someone glitching inside. Perhaps you could make some permanent indicator of some sort that shows the base owners that someone got in with a lockpicker. Link to comment Share on other sites More sharing options...
DirtySanchez Posted April 12, 2015 Report Share Posted April 12, 2015 upon successful entry, get player position, place one of the helpers or spheres at current pos....Or better yet, one of the signs or a custom sign, hell place a JPG at its location with a sweet EVICTION notice or You've been ROBBED.Lol im sure people will run with this addition and make it fun Link to comment Share on other sites More sharing options...
Tobias Solem Posted April 13, 2015 Report Share Posted April 13, 2015 upon successful entry, get player position, place one of the helpers or spheres at current pos.... Or better yet, one of the signs or a custom sign, hell place a JPG at its location with a sweet EVICTION notice or You've been ROBBED. Lol im sure people will run with this addition and make it fun Mmm, not a fan of that. If you drop some item that saves to the database, that might make for a lot of clutter and a bunch of oddly placed materials. Perhaps downgrading the door one step would be enough of an indicator (ie. that the electronic lock breaks and thus the base owners have to re-upgrade it?). I was also thinking that perhaps breaking into a car, chopper, boat, or base should come with different chances and/or even material costs? I would think a security door would require more effort for example. Perhaps you also could add so that you need an amount of energy to accomplish this (to power the lockpick so to speak), this would help with making "infinite" attempts if you have a large group of players. Speaking of which, we found out that there can be several people attempting to lockpick the same door, perhaps also a check for a nearby player is in order (ie. "Someone else is tampering with the lock at the moment, please wait your turn") or something. Link to comment Share on other sites More sharing options...
second_coming Posted April 13, 2015 Author Report Share Posted April 13, 2015 Mmm, not a fan of that. If you drop some item that saves to the database, that might make for a lot of clutter and a bunch of oddly placed materials. Perhaps downgrading the door one step would be enough of an indicator (ie. that the electronic lock breaks and thus the base owners have to re-upgrade it?). I was also thinking that perhaps breaking into a car, chopper, boat, or base should come with different chances and/or even material costs? I would think a security door would require more effort for example. Perhaps you also could add so that you need an amount of energy to accomplish this (to power the lockpick so to speak), this would help with making "infinite" attempts if you have a large group of players. Speaking of which, we found out that there can be several people attempting to lockpick the same door, perhaps also a check for a nearby player is in order (ie. "Someone else is tampering with the lock at the moment, please wait your turn") or something. Taking time and energy to complete I can add as server configurable variables, I'd need to see if I can manipulate the door model though, I could force 50% damage to any unlocked door so that the model for the door changes to show damage. Not sure if I could actually get it to downgrade the wall type to remove the lock but I'll certainly have a look. Link to comment Share on other sites More sharing options...
DirtySanchez Posted April 13, 2015 Report Share Posted April 13, 2015 Well I know better than to argue with ya Tobias, you give too much good info here that I have used for DP'S benefit, but signs and spheres won't save to the database like that they should just disappear after restart, at least that was my intention in that post. Only reason I feel that way is plenty of servers have deployables that you can use for one restart period... Even if saved a cleanup script can be put in place to run at server start that would delete any robbed signs if in fact they save to the database. Link to comment Share on other sites More sharing options...
Neka7350 Posted April 13, 2015 Report Share Posted April 13, 2015 Hello second_coming, First, I have to say that's a great script you released here. Thank you very much. I tested it and saw that everything is working very well except one thing : When the unlocking of a vehicle is success, the vehicle is still lock. I saw in your script that the function for the unlocking of a vehicle is empty (except the hint) : else { hint "The AutoLockPicker worked! Unlocking Vehicle"; } So I just decided to add " _nearVehicle lock 0; " after the hint like that : else { hint "The AutoLockPicker worked! Unlocking Vehicle"; _nearVehicle lock 0; } So I can enter in the vehicle but I'm stuck in it because he stay lock. You confirm that the autolockpick of vehicle isn't working ? Thank you again. Greetings, Neka Link to comment Share on other sites More sharing options...
1Man Posted April 13, 2015 Report Share Posted April 13, 2015 I think if it can show damage on nearest door/wall then it would be an indicator Link to comment Share on other sites More sharing options...