Defuse bomb tweaks + checks

This commit is contained in:
He-Man 2019-01-20 15:32:57 +01:00
parent 56e504e92a
commit 5b1b054b4c
2 changed files with 21 additions and 19 deletions

View File

@ -6,25 +6,27 @@ if (({alive _x && isplayer _x} count (_object nearentities 6)) > 1) exitwith {
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.6] call EPOCH_fnc_returnConfigEntryV2;
if (_chance >= ((random 100) / 100)) then {
[_object,false,player,Epoch_personalToken] remoteexec ["EPOCH_server_DefuseBomb",2];
}
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;
};
[_object,true,player,Epoch_personalToken] remoteexec ["EPOCH_server_DefuseBomb",2];
};
_starttime = diag_ticktime;
waituntil {uisleep 0.5; diag_ticktime - _starttime > 8 || player distance _object > 5 || EPOCH_IsAutoRunning || isnull _object || !alive player};
if (player distance _object > 5 || EPOCH_IsAutoRunning || isnull _object || !alive player) exitwith {
["Defusing abort... ",5] call Epoch_Message;
};
_reward = gettext (configfile >> "cfgammo" >> _type >> "defaultMagazine");
if !(_reward isequalto "") then {
_chance = ["CfgEpochClient", "DefuseBombChance", 0.6] call EPOCH_fnc_returnConfigEntryV2;
if (_chance >= ((random 100) / 100)) then {
[_object,false,player,Epoch_personalToken] remoteexec ["EPOCH_server_DefuseBomb",2];
}
else {
[format ['Sorry, can not defuse %1',_type],5] call Epoch_Message;
['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;
};
[_object,true,player,Epoch_personalToken] remoteexec ["EPOCH_server_DefuseBomb",2];
};
};
}
else {
[format ['Sorry, can not defuse %1',_type],5] call Epoch_Message;
};

View File

@ -27,7 +27,7 @@ params [
];
if (isNull _object) exitWith{};
if !([_player, _token] call EPOCH_server_getPToken) exitWith{};
if (_player distance _object > 20) exitWith{};
if (_player distance _object > 50) exitWith{};
if (_value) then {
'HelicopterExploSmall' createVehicle (position _object);
deletevehicle _object;