mirror of
https://github.com/EpochModTeam/Epoch.git
synced 2024-08-30 18:22:13 +00:00
Defuse Bombs (WIP)
This commit is contained in:
parent
c9e9613f89
commit
20c0cf7412
33
Sources/epoch_code/compile/EPOCH_DefuseBomb.sqf
Normal file
33
Sources/epoch_code/compile/EPOCH_DefuseBomb.sqf
Normal 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;
|
||||
};
|
||||
};
|
||||
|
BIN
Sources/epoch_code/customs/Defuse.paa
Normal file
BIN
Sources/epoch_code/customs/Defuse.paa
Normal file
Binary file not shown.
@ -593,5 +593,12 @@ class ConnectUAV
|
||||
icon = "x\addons\a3_epoch_code\Data\UI\buttons\epoch_UAV.paa";
|
||||
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";
|
||||
};
|
||||
|
||||
|
||||
|
@ -53,6 +53,7 @@ class CfgClientFunctions
|
||||
class AutoRun {};
|
||||
class DefibrillatorUse {};
|
||||
class CamUse {};
|
||||
class DefuseBomb {};
|
||||
};
|
||||
class building
|
||||
{
|
||||
|
@ -65,6 +65,8 @@ class CfgEpochClient
|
||||
ActionFireOnLighter = "true"; // Lighter is needed to inflame fires
|
||||
ActionBurnBarrelOffExtinguisher = "true"; // FireExtinguisher is needed to put off Burn Barrels
|
||||
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})
|
||||
epochMessageTextCol[] = {1,1,1,0.95}; //Epoch_message text color (format: {R,G,B,A})
|
||||
|
Loading…
Reference in New Issue
Block a user