mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-21 10:56:29 +03:00
Add medic anim function with proper interrupt
Closes #1386 Vanilla commits applied:f99a3deced731b957e8eRemoved two unused files and a few variables made redundant by actionInProgress
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
private ["_theBomb","_vehicle","_curFuel","_newFuel","_timeLeft","_hasToolbox","_hasCarBomb","_dis","_sfx","_alreadyBombed","_hasCrowbar"];
|
||||
private ["_theBomb","_vehicle","_curFuel","_newFuel","_timeLeft","_hasToolbox","_hasCarBomb","_dis","_sfx","_alreadyBombed","_hasCrowbar","_finished"];
|
||||
|
||||
_vehicle = _this select 3;
|
||||
_hasToolbox = "ItemToolbox" in items player;
|
||||
@@ -12,27 +12,32 @@ if(!_hasCarBomb) exitWith {
|
||||
localize "str_bombMissing" call dayz_rollingMessages;
|
||||
};
|
||||
|
||||
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
|
||||
dayz_actionInProgress = true;
|
||||
|
||||
/*
|
||||
if(_vehicle getVariable["hasBomb",false]) exitWith {
|
||||
localize "str_bombAlready" call dayz_rollingMessages;
|
||||
};
|
||||
*/
|
||||
|
||||
player removeMagazine "ItemCarBomb";
|
||||
|
||||
//wait a bit
|
||||
player playActionNow "Medic";
|
||||
uiSleep 1;
|
||||
|
||||
//DO Animation
|
||||
_dis=20;
|
||||
_sfx = "tentunpack";
|
||||
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
||||
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
_finished = ["Medic",1] call fn_loopAction;
|
||||
if (!_finished or !("ItemCarBomb" in magazines player)) exitWith {
|
||||
dayz_actionInProgress = false;
|
||||
};
|
||||
|
||||
player removeMagazine "ItemCarBomb";
|
||||
|
||||
//Send the Eventhandler to Server
|
||||
if(!_alreadyBombed) then {
|
||||
PVDZ_dayzCarBomb = [_vehicle,getPlayerUID player];
|
||||
publicVariableServer "PVDZ_dayzCarBomb";
|
||||
};
|
||||
localize "str_bombAttached" call dayz_rollingMessages;
|
||||
localize "str_bombAttached" call dayz_rollingMessages;
|
||||
dayz_actionInProgress = false;
|
||||
Reference in New Issue
Block a user