Add medic anim function with proper interrupt

Closes #1386

Vanilla commits
applied:
f99a3deced
731b957e8e

Removed
two unused files and a few variables made redundant by actionInProgress
This commit is contained in:
ebayShopper
2017-06-06 15:24:59 -04:00
parent 36b67affee
commit 48858b2e6c
61 changed files with 507 additions and 1341 deletions

View File

@@ -4,7 +4,7 @@
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_alreadyPacking","_backpacks","_bag","_campItems","_countr","_dir","_holder","_magazines","_obj","_objWpnQty","_objWpnTypes","_objectID","_objectUID","_ownerID","_packobj","_playerNear","_pos","_weapons"];
private ["_alreadyPacking","_backpacks","_bag","_campItems","_countr","_dir","_holder","_magazines","_obj","_objWpnQty","_objWpnTypes","_objectID","_objectUID","_ownerID","_packobj","_playerNear","_pos","_weapons","_finished"];
_obj = _this;
_ownerID = _obj getVariable["CharacterID","0"];
@@ -14,10 +14,6 @@ if (DZE_permanentPlot) then {
_ownerID = _obj getVariable["ownerPUID","0"];
};
// Make sure you are the closest player to the tent
_playerNear = _obj call dze_isnearest_player;
if (_playerNear) exitWith {dayz_actionInProgress = false; localize "str_epoch_player_16" call dayz_rollingMessages;};
// Make sure no other players are nearby
_playerNear = {isPlayer _x} count (([_obj] call FNC_GetPos) nearEntities ["CAManBase",10]) > 1;
if (_playerNear) exitWith {dayz_actionInProgress = false; localize "str_pickup_limit_5" call dayz_rollingMessages;};
@@ -32,7 +28,6 @@ s_player_packtentinfected = -1;
_campItems = ["IC_DomeTent","IC_Tent"];
if (_ownerID in [dayz_characterID,dayz_playerUID] or typeOf _obj in _campItems) then {
player playActionNow "Medic";
_alreadyPacking = _obj getVariable["packing",0];
if (_alreadyPacking == 1) exitWith {localize "str_player_beingpacked" call dayz_rollingMessages;};
@@ -42,7 +37,10 @@ if (_ownerID in [dayz_characterID,dayz_playerUID] or typeOf _obj in _campItems)
[player,"tentpack",0,false,20] call dayz_zombieSpeak;
[player,20,true,getPosATL player] call player_alertZombies;
uiSleep 3;
_finished = ["Medic",1] call fn_loopAction;
if (isNull _obj) exitWith {};
if (!_finished) exitWith {_obj setVariable["packing",0,true];};
//place tent (local)
_bag = createVehicle [_packobj, _pos, [], 0, "CAN_COLLIDE"];