Defuse Bombs (WIP)

This commit is contained in:
He-Man 2019-01-09 21:57:35 +01:00
parent c9e9613f89
commit 20c0cf7412
5 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,33 @@
_object = _this;
_type = typeof _object;
if (({alive _x && isplayer _x} count (_object nearentities 6)) > 1) exitwith {
["You should not defuse Bombs next to other Players!",5] call Epoch_Message;
};
player playMove 'AinvPknlMstpSnonWrflDnon_medic0';
player playMove 'AinvPknlMstpSnonWrflDnon_medicEnd';
_object say3d 'vehicle_repair';
uisleep 5;
if (alive player && !isnull _object) then {
_reward = gettext (configfile >> "cfgammo" >> _type >> "defaultMagazine");
if !(_reward isequalto "") then {
_chance = ["CfgEpochClient", "DefuseBombChance", 0.4] call EPOCH_fnc_returnConfigEntryV2;
if (_chance >= ((random 100) / 100)) then {
deletevehicle _object;
_reward call EPOCH_fnc_addItemOverflow;
[format ['Sucessfully defused %1 - You have it now in your Inventory',_reward call Epoch_ItemDisplayName],5] call Epoch_Message;
}
else {
['Oh No... The Bomb will explode in a few seconds... RUN!!!!',5] call Epoch_Message;
for '_i' from 1 to 6 do {
playSound3D ['a3\sounds_f\air\heli_attack_02\alarm.wss', player, false,getposasl _object, 1, 1, 300];
uisleep 1;
};
'HelicopterExploSmall' createVehicle (position _object);
deletevehicle _object;
};
}
else {
[format ['Sorry, can not defuse %1',_type],5] call Epoch_Message;
};
};

Binary file not shown.

View File

@ -593,5 +593,12 @@ class ConnectUAV
icon = "x\addons\a3_epoch_code\Data\UI\buttons\epoch_UAV.paa"; icon = "x\addons\a3_epoch_code\Data\UI\buttons\epoch_UAV.paa";
tooltip = "Connect to UAV"; tooltip = "Connect to UAV";
}; };
class Defuse_Bomb
{
condition = "if (player != vehicle player) exitwith {false};if (player distance dyna_cursorTarget > 3.5) exitwith {false};!((gettext (configfile >> 'cfgammo' >> (typeof dyna_cursorTarget) >> 'defaultMagazine')) isEqualTo '')";
action = "dyna_cursorTarget spawn Epoch_DefuseBomb";
icon = "epoch_code\customs\Defuse.paa";
tooltip = "Defuse Bomb";
};

View File

@ -53,6 +53,7 @@ class CfgClientFunctions
class AutoRun {}; class AutoRun {};
class DefibrillatorUse {}; class DefibrillatorUse {};
class CamUse {}; class CamUse {};
class DefuseBomb {};
}; };
class building class building
{ {

View File

@ -65,6 +65,8 @@ class CfgEpochClient
ActionFireOnLighter = "true"; // Lighter is needed to inflame fires ActionFireOnLighter = "true"; // Lighter is needed to inflame fires
ActionBurnBarrelOffExtinguisher = "true"; // FireExtinguisher is needed to put off Burn Barrels ActionBurnBarrelOffExtinguisher = "true"; // FireExtinguisher is needed to put off Burn Barrels
ActionHookRope = "true"; // Rope is needed to hook vehicles (get back on release) ActionHookRope = "true"; // Rope is needed to hook vehicles (get back on release)
DefuseBombChance = 0.4; // Chance for successfully defuse a bomb -> If fail, the bomb will explode
epochMessageBackgroundCol[] = {0,0,0,0.2}; //Epoch_message background color (format: {R,G,B,A}) epochMessageBackgroundCol[] = {0,0,0,0.2}; //Epoch_message background color (format: {R,G,B,A})
epochMessageTextCol[] = {1,1,1,0.95}; //Epoch_message text color (format: {R,G,B,A}) epochMessageTextCol[] = {1,1,1,0.95}; //Epoch_message text color (format: {R,G,B,A})