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

@@ -1,4 +1,4 @@
private ["_bottletext","_tin1text","_tin2text","_tintext","_hastinitem","_qty","_dis","_sfx","_WB2Add"];
private ["_bottletext","_tin1text","_tin2text","_tintext","_hastinitem","_qty","_dis","_sfx","_WB2Add","_finished"];
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
@@ -8,10 +8,7 @@ _tin1text = getText (configFile >> "CfgMagazines" >> "TrashTinCan" >> "displayNa
_tin2text = getText (configFile >> "CfgMagazines" >> "ItemSodaEmpty" >> "displayName");
_tintext = format["%1 / %2",_tin1text,_tin2text];
//_hasbottleitem = (("ItemWaterBottle" in magazines player) || {"ItemWaterBottleInfected" in magazines player} || {"ItemWaterBottleSafe" in magazines player});
_qty = 0;
_qty = _qty + ({
_x in ["ItemWaterBottleInfected","ItemWaterBottle","ItemWaterBottleSafe","ItemWaterbottle1oz","ItemWaterbottle2oz","ItemWaterbottle3oz","ItemWaterbottle4oz","ItemWaterbottle5oz","ItemWaterbottle6oz","ItemWaterbottle7oz","ItemWaterbottle8oz","ItemWaterbottle9oz"];
} count magazines player);
_qty = {_x in ["ItemWaterBottleInfected","ItemWaterBottle","ItemWaterBottleSafe","ItemWaterbottle1oz","ItemWaterbottle2oz","ItemWaterbottle3oz","ItemWaterbottle4oz","ItemWaterbottle5oz","ItemWaterbottle6oz","ItemWaterbottle7oz","ItemWaterbottle8oz","ItemWaterbottle9oz"]} count magazines player;
a_player_boil = true;
player removeAction s_player_boil;
//s_player_boil = -1;
@@ -28,13 +25,17 @@ _hastinitem = false;
if (!_hastinitem) exitWith {format[localize "str_player_31",_tintext,localize "str_player_31_fill"] call dayz_rollingMessages; a_player_boil = false; dayz_actionInProgress = false;};
*/
if (_qty > 0) then {
player playActionNow "Medic";
uiSleep 1;
_dis=10;
_sfx = "cook";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
uiSleep 5;
_finished = ["Medic",1] call fn_loopAction;
// Double check player did not drop item
_qty = {_x in ["ItemWaterBottleInfected","ItemWaterBottle","ItemWaterBottleSafe","ItemWaterbottle1oz","ItemWaterbottle2oz","ItemWaterbottle3oz","ItemWaterbottle4oz","ItemWaterbottle5oz","ItemWaterbottle6oz","ItemWaterbottle7oz","ItemWaterbottle8oz","ItemWaterbottle9oz"]} count magazines player;
if (_qty == 0 or !_finished) exitWith {};
for "_x" from 1 to _qty do {
_WB2Add = "ItemWaterBottleBoiled";

View File

@@ -1,4 +1,4 @@
private ["_rawmeat","_cookedmeat","_meat","_meatcooked","_text","_qty","_dis","_sfx"];
private ["_rawmeat","_cookedmeat","_meat","_meatcooked","_text","_qty","_dis","_sfx","_finished"];
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
//diag_log ("Cook Enabled");
@@ -8,21 +8,24 @@ s_player_cook = -1;
_rawmeat = Dayz_meatraw;
_cookedmeat = Dayz_meatcooked;
a_player_cooking = true;
_finished = true;
{
_meat = _x;
_meatcooked = _cookedmeat select (_rawmeat find _meat);
if (_meat in magazines player) then {
_text = getText (configFile >> "CfgMagazines" >> _meatcooked >> "displayName");
_qty = {_x == _meat} count magazines player;
player playActionNow "Medic";
_dis=6;
_sfx = "cook";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
uiSleep _qty;
_finished = ["Medic",1] call fn_loopAction;
if (!_finished) exitWith {};
_qty = {_x == _meat} count magazines player;
for "_x" from 1 to _qty do {
player removeMagazine _meat;
player addMagazine _meatcooked;
@@ -31,6 +34,8 @@ a_player_cooking = true;
};
format[localize "str_success_cooked",_qty,_text] call dayz_rollingMessages;
};
if (!_finished) exitWith {};
} forEach _rawmeat;
a_player_cooking = false;

View File

@@ -1,4 +1,4 @@
private ["_isFuelTruck","_fuelTruckCapacity","_started","_finished","_animState","_isMedic","_newFuel","_abort","_newFuelSrc","_canSize","_vehicle","_configVeh","_capacity","_nameText","_fuelTruck","_findNearestVehicle"];
private ["_isFuelTruck","_fuelTruckCapacity","_finished","_newFuel","_abort","_newFuelSrc","_canSize","_vehicle","_configVeh","_capacity","_nameText","_fuelTruck","_findNearestVehicle"];
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
@@ -15,10 +15,10 @@ if (!isNull _fuelTruck) then {
_findNearestVehicle = [];
{
if ((alive _x) && (_x != _fuelTruck) && (!(_x isKindOf "Man"))) exitWith {
if (_x != _fuelTruck) exitWith {
_findNearestVehicle set [(count _findNearestVehicle),_x];
};
} count (nearestObjects [player, ["AllVehicles"], 30]);
} count (([player] call fnc_getPos) nearEntities [["Air","LandVehicle","Ship"],30]);
if (count _findNearestVehicle >= 1) then {
// select the nearest one
@@ -35,43 +35,10 @@ if (count _findNearestVehicle >= 1) then {
_canSize = (_capacity / 10);
format[localize "str_epoch_player_131",_nameText] call dayz_rollingMessages;
// alert zombies
[player,20,true,(getPosATL player)] spawn player_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
_finished = false;
// force animation
player playActionNow "Medic";
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
};
uiSleep 0.1;
};
r_doLoop = false;
if(!_finished) then {
r_interrupt = false;
if ((vehicle player) == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
if (!_finished) then {
_abort = true;
} else {
_newFuel = (((fuel _vehicle) * _capacity) + _canSize);

View File

@@ -1,4 +1,4 @@
private ["_vehicle","_started","_finished","_animState","_isMedic","_soundSource","_fuelCan","_emptyCan"];
private ["_vehicle","_finished","_soundSource","_fuelCan","_emptyCan"];
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
@@ -7,46 +7,13 @@ player removeAction s_player_fillgen;
s_player_fillgen = 1;
// Use target from addaction
_vehicle = _this select 3;
// force animation
player playActionNow "Medic";
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
_vehicle = _this select 3;
localize "str_epoch_player_25" call dayz_rollingMessages;
[player,50,true,(getPosATL player)] spawn player_alertZombies;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
};
uiSleep 0.1;
};
r_doLoop = false;
if(!_finished) then {
r_interrupt = false;
if (vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
localize "str_epoch_player_26" call dayz_rollingMessages;
};
_finished = ["Medic",1] call fn_loopAction;
_fuelCan = nil;
{
@@ -91,6 +58,8 @@ if (_finished) then {
localize "str_epoch_player_28" call dayz_rollingMessages;
};
} else {
localize "str_epoch_player_26" call dayz_rollingMessages;
};
dayz_actionInProgress = false;

View File

@@ -1,14 +0,0 @@
private "_obj";
_obj = _this select 3;
player playActionNow "Medic";
uiSleep 6;
if (_obj isKindOf "Land_fire") then {
dayz_hasFire = objNull;
deleteVehicle _obj;
};
localize "str_fireplace_removed" call dayz_rollingMessages;
player removeAction s_player_fireout;
s_player_fireout = -1;

View File

@@ -1,6 +1,5 @@
private ["_item","_type","_hasHarvested","_knifeArray","_PlayerNear","_isListed","_activeKnife","_text","_dis","_sfx","_qty","_string","_isZombie","_humanity"];
private ["_item","_type","_hasHarvested","_knifeArray","_PlayerNear","_isListed","_activeKnife","_text","_dis","_sfx","_qty","_string","_isZombie","_humanity","_finished"];
_isZombie = _this isKindOf "zZombie_base";
if (dayz_actionInProgress) exitWith {
localize "str_player_actionslimit" call dayz_rollingMessages;
};
@@ -8,6 +7,7 @@ dayz_actionInProgress = true;
_item = _this;
_type = typeOf _item;
_isZombie = _type isKindOf "zZombie_base";
_hasHarvested = _item getVariable["meatHarvested",false];
_knifeArray = [];
@@ -39,11 +39,13 @@ if ((count _knifeArray > 0) and !_hasHarvested) then {
_isListed = isClass (configFile >> "CfgSurvival" >> "Meat" >> _type);
_text = getText (configFile >> "CfgVehicles" >> _type >> "displayName");
player playActionNow "Medic";
_dis=10;
_sfx = "gut";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
if (!_finished) exitWith {};
// Added Nutrition-Factor for work
["Working",0,[20,40,15,0]] call dayz_NutritionSystem;
@@ -64,7 +66,6 @@ if ((count _knifeArray > 0) and !_hasHarvested) then {
["knives",0.2] call fn_dynamicTool;
uiSleep 6;
if (_isZombie) then {
// Reduce humanity for gutting zeds
_humanity = player getVariable ["humanity",0];

View File

@@ -1,4 +1,4 @@
private ["_time","_vehicle","_removed","_vehType"];
private ["_time","_vehicle","_removed","_vehType","_finished"];
_vehicle = _this select 3;
if (dayz_actionInProgress) exitWith {localize "STR_EPOCH_PLAYER_32" call dayz_rollingMessages;};
@@ -12,10 +12,13 @@ s_player_lockUnlockInside_ctrl = 1;
_removed = ([player,"ItemHotwireKit",1] call BIS_fnc_invRemove);
if (_removed == 1) then {
player playActionNow "Medic";
[player,"repair",0,false] call dayz_zombieSpeak;
[player,50,true,(getPosATL player)] spawn player_alertZombies;
uiSleep 8;
_finished = ["Medic",1] call fn_loopAction;
if (!_finished) exitWith {
player addMagazine "ItemHotwireKit";
};
_vehType = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName");
if ((random 10) <= 7.5) then {

View File

@@ -1,6 +1,6 @@
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_qty","_dis","_sfx","_started","_finished","_animState","_isRefuel","_qty20","_qty5","_qty210","_magazines","_cursorTarget","_fuelAmount","_fuelNeeded"];
private ["_qty","_dis","_sfx","_finished","_qty20","_qty5","_qty210","_magazines","_cursorTarget","_fuelAmount","_fuelNeeded"];
player removeAction s_player_fillfuel;
//s_player_fillfuel = -1;
@@ -29,70 +29,51 @@ if (_fuelAmount < _fuelNeeded) then {format[localize "str_fill_notenough",typeOf
if (_fuelAmount < 5 or (_fuelAmount < 20 && _qty5 == 0) or (_fuelAmount < 210 && (_qty5 == 0 && _qty20 == 0))) exitWith {dayz_actionInProgress = false;};
if (_qty > 0) then {
player playActionNow "Medic";
_dis=5;
_sfx = "refuel";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
if (!_finished) exitWith {};
// Added Nutrition-Factor for work
["Working",0,[20,40,15,0]] call dayz_NutritionSystem;
r_doLoop = true;
_started = false;
_finished = false;
while {r_doLoop} do {
_animState = animationState player;
_isRefuel = ["medic",_animState] call fnc_inString;
if (_isRefuel) then {
_started = true;
for "_x" from 1 to _qty5 do {
_fuelAmount = _cursorTarget getVariable "FuelAmount";
if (_fuelAmount >= 5) then {
_fuelAmount = _fuelAmount - 5;
_cursorTarget setVariable ["FuelAmount",_fuelAmount,true];
player removeMagazine "ItemFuelcanEmpty";
player addMagazine "ItemFuelcan";
} else {
_qty = _qty - 1;
};
if (_started and !_isRefuel) then {
r_doLoop = false;
_finished = true;
};
uiSleep 0.1;
};
r_doLoop = false;
if (_finished) then {
for "_x" from 1 to _qty5 do {
_fuelAmount = _cursorTarget getVariable "FuelAmount";
if (_fuelAmount >= 5) then {
_fuelAmount = _fuelAmount - 5;
_cursorTarget setVariable ["FuelAmount",_fuelAmount,true];
player removeMagazine "ItemFuelcanEmpty";
player addMagazine "ItemFuelcan";
} else {
_qty = _qty - 1;
};
for "_x" from 1 to _qty20 do {
_fuelAmount = _cursorTarget getVariable "FuelAmount";
if (_fuelAmount >= 20) then {
_fuelAmount = _fuelAmount - 20;
_cursorTarget setVariable ["FuelAmount",_fuelAmount,true];
player removeMagazine "ItemJerrycanEmpty";
player addMagazine "ItemJerrycan";
} else {
_qty = _qty - 1;
};
for "_x" from 1 to _qty20 do {
_fuelAmount = _cursorTarget getVariable "FuelAmount";
if (_fuelAmount >= 20) then {
_fuelAmount = _fuelAmount - 20;
_cursorTarget setVariable ["FuelAmount",_fuelAmount,true];
player removeMagazine "ItemJerrycanEmpty";
player addMagazine "ItemJerrycan";
} else {
_qty = _qty - 1;
};
};
for "_x" from 1 to _qty210 do {
_fuelAmount = _cursorTarget getVariable "FuelAmount";
if (_fuelAmount >= 210) then {
_fuelAmount = _fuelAmount - 210;
_cursorTarget setVariable ["FuelAmount",_fuelAmount,true];
player removeMagazine "ItemFuelBarrelEmpty";
player addMagazine "ItemFuelBarrel";
} else {
_qty = _qty - 1;
};
};
for "_x" from 1 to _qty210 do {
_fuelAmount = _cursorTarget getVariable "FuelAmount";
if (_fuelAmount >= 210) then {
_fuelAmount = _fuelAmount - 210;
_cursorTarget setVariable ["FuelAmount",_fuelAmount,true];
player removeMagazine "ItemFuelBarrelEmpty";
player addMagazine "ItemFuelBarrel";
} else {
_qty = _qty - 1;
};
};

View File

@@ -1,7 +1,6 @@
// If an array was passed redirect to vanilla player_build (Epoch items pass a string)
if (!isNil "_this" && {typeName _this == "ARRAY"} && {count _this > 0}) exitWith {_this spawn player_buildVanilla;};
private ["_abort","_reason","_distance","_isNear","_lockable","_isAllowedUnderGround","_offset","_classname","_zheightdirection","_zheightchanged","_rotate","_objectHelperPos","_objectHelperDir","_objHDiff","_position","_isOk","_dir","_vector","_cancel","_location2","_buildOffset","_location","_limit","_started","_finished","_animState","_isMedic","_proceed","_counter","_dis","_sfx","_combination_1_Display","_combination_1","_combination_2","_combination_3","_combination","_combinationDisplay","_combination_4","_num_removed","_tmpbuilt","_vUp","_classnametmp","_text","_ghost","_ghost2","_VectorWorkAround","_objectHelper","_location1","_object","_object2","_helperColor","_canDo","_pos","_onLadder","_vehicle","_inVehicle","_needNear","_canBuild"];
private ["_abort","_reason","_distance","_isNear","_lockable","_isAllowedUnderGround","_offset","_classname","_zheightdirection","_zheightchanged","_rotate","_objectHelperPos","_objectHelperDir","_objHDiff","_position","_isOk","_dir","_vector","_cancel","_location2","_buildOffset","_location","_limit","_finished","_proceed","_counter","_dis","_sfx","_combination_1_Display","_combination_1","_combination_2","_combination_3","_combination","_combinationDisplay","_combination_4","_num_removed","_tmpbuilt","_vUp","_classnametmp","_text","_ghost","_ghost2","_VectorWorkAround","_objectHelper","_location1","_object","_object2","_helperColor","_canDo","_pos","_onLadder","_vehicle","_inVehicle","_needNear","_canBuild"];
if (dayz_actionInProgress) exitWith {localize "str_epoch_player_40" call dayz_rollingMessages;};
dayz_actionInProgress = true;
@@ -445,37 +444,13 @@ if (_canBuild select 0) then {
while {_isOk} do {
format[localize "str_epoch_player_139",_text, (_counter + 1),_limit] call dayz_rollingMessages; //report how many steps are done out of total limit
player playActionNow "Medic";
_dis=20;
_sfx = "repair";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
r_interrupt = false;
r_doLoop = true;
_started = false;
_finished = false;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt || (player getVariable["combattimeout",0] >= diag_tickTime)) then {
r_doLoop = false;
};
if (DZE_cancelBuilding) exitWith {
r_doLoop = false;
};
uiSleep 0.1;
};
r_doLoop = false;
_finished = ["Medic",1,{player getVariable["combattimeout",0] >= diag_tickTime or DZE_cancelBuilding}] call fn_loopAction;
if(!_finished) exitWith {
_isOk = false;
@@ -490,7 +465,6 @@ if (_canBuild select 0) then {
_isOk = false;
_proceed = true;
};
};
if (_proceed) then {
@@ -596,15 +570,8 @@ if (_canBuild select 0) then {
localize "str_epoch_player_46" call dayz_rollingMessages;
};
} else { //if player was interrupted, cancel publish and stop build animations
r_interrupt = false;
if (vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
} else { //if player was interrupted cancel publish
deleteVehicle _tmpbuilt;
localize "str_epoch_player_46" call dayz_rollingMessages;
};

View File

@@ -105,6 +105,4 @@ if (_build) then {
};
} foreach _items;
format[localize "str_build_failed_02",_text] call dayz_rollingMessages;
};
dayz_actionInProgress = false;
};

View File

@@ -13,8 +13,6 @@ if ((isNil "_cursorTarget") or {(isNull _cursorTarget)}) then {
if(isNull _cursorTarget) exitWith { localize "str_disassembleNoOption" call dayz_rollingMessages; };
if (player getVariable["alreadyBuilding",0] == 1) exitWith { localize "str_upgradeInProgress" call dayz_rollingMessages; };
//Normal blocked stuff
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_isWater = (surfaceIsWater (getPosATL player)) or dayz_isSwimming;
@@ -23,6 +21,9 @@ if(_isWater or _onLadder) exitWith { localize "str_water_ladder_cant_do" call da
_alreadyRemoving = _cursorTarget getVariable["ObjectLocked",0];
if (_alreadyRemoving == 1) exitWith { localize "str_disassembleInProgress" call dayz_rollingMessages; };
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
_cursorTarget setVariable["ObjectLocked",1,true];
_characterID = _cursorTarget getVariable ["characterID","0"];
_objectID = _cursorTarget getVariable ["ObjectID","0"];
@@ -39,7 +40,7 @@ _entry = configFile >> "CfgVehicles" >> _upgrade;
r_interrupt = false;
_disassemblyParts = [] + (getArray (_entry >> "Disassembly" >> "removedParts"));
_disassemblyReturnChance = [] + (getNumber (_entry >> "Disassembly" >> "removedChance"));
_disassemblyReturnChance = getNumber (_entry >> "Disassembly" >> "removedChance");
for "_i" from 1 to 20 do {
_parent = inheritsFrom _entry;
@@ -161,4 +162,4 @@ if (!_realObjectStillThere) then {
localize "str_disassembleDone" call dayz_rollingMessages;
_cursorTarget setVariable["ObjectLocked",0,true];
dayz_actionInProgress = false;

View File

@@ -1,7 +1,7 @@
if (dayz_actionInProgress) exitWith { localize "str_player_actionslimit" call dayz_rollingMessages; };
dayz_actionInProgress = true;
private ["_object","_proceed","_rndattemps","_limit","_dismantleToo","_ownerID","_objectID","_objectUID","_playerID","_claimedBy","_tools","_exit","_end","_onLadder","_isWater","_isOk","_counter","_text","_dis","_sfx","_animState","_started","_finished","_isMedic"];
private ["_object","_proceed","_rndattemps","_limit","_dismantleToo","_ownerID","_objectID","_objectUID","_playerID","_claimedBy","_tools","_exit","_end","_onLadder","_isWater","_isOk","_counter","_text","_dis","_sfx","_finished"];
_object = _this;
_proceed = false;
@@ -67,43 +67,14 @@ while {_isOk} do {
if (_claimedBy != _playerID) exitWith { format[localize "str_player_beinglooted",_text] call dayz_rollingMessages; };
//Run animation
player playActionNow "Medic";
//Run SFX
_dis=20;
_sfx = "repair";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
// Working-Factor for chopping wood.
["Working",0,[100,15,10,0]] call dayz_NutritionSystem;
//Setup Vars
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
//run animation loop
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt or (player getVariable["combattimeout",0] >= diag_tickTime)) then {
r_doLoop = false;
_finished = false;
};
uiSleep 0.1;
};
r_doLoop = false;
//Run animation loop
_finished = ["Medic",1,{player getVariable["combattimeout",0] >= diag_tickTime}] call fn_loopAction;
//Interrupt and end
if(!_finished) exitWith {
@@ -112,7 +83,9 @@ while {_isOk} do {
};
//Everything happened as it should
if(_finished) then {
if(_finished) then {
// Working-Factor for chopping wood.
["Working",0,[100,15,10,0]] call dayz_NutritionSystem;
//Add to Counter
_counter = _counter + 1;
//Try to dismantle

View File

@@ -5,7 +5,7 @@
#define MAINTENANCE_NUTRITION_VALUES [20,40,15,0]
private ["_isMedic","_cursorTarget","_item","_classname","_displayname","_requiredTools","_requiredParts","_onLadder","_isWater","_upgradeParts","_startMaintenance","_dis","_sfx","_started","_finished","_animState","_isRefuel"];
private ["_cursorTarget","_item","_classname","_displayname","_requiredTools","_requiredParts","_onLadder","_isWater","_startMaintenance","_dis","_sfx","_finished"];
_cursorTarget = _this;
@@ -19,10 +19,6 @@ if(isNull _cursorTarget) exitWith {
localize "str_maintenanceNoOption" call dayz_rollingMessages;
};
if (player getVariable["alreadyBuilding",0] == 1) exitWith {
localize "str_upgradeInProgress" call dayz_rollingMessages;
};
//Item
_item = typeof _cursorTarget;
//diag_log (str(_item));
@@ -42,13 +38,15 @@ _requiredParts = getArray (_classname >> "Maintenance" >> "requiredParts");
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_isWater = (surfaceIsWater (getPosATL player)) or dayz_isSwimming;
_upgradeParts = [];
_startMaintenance = true;
if(_isWater or _onLadder) exitWith {
localize "str_water_ladder_cant_do" call dayz_rollingMessages;
};
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
// lets check player has requiredTools for upgrade
{
if (!(_x IN items player)) exitWith {
@@ -67,36 +65,27 @@ if(_isWater or _onLadder) exitWith {
if (_startMaintenance) then {
//play animation
player playActionNow "Medic";
_dis=20;
_sfx = "tentpack";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
["Working",0,MAINTENANCE_NUTRITION_VALUES] call dayz_NutritionSystem; // Added Nutrition-Factor for work
{ player removeMagazine _x; } count _requiredParts;
//Animation Loop
r_doLoop = true;
_started = false;
_finished = false;
while {r_doLoop} do {
_animState = animationState player;
_isRefuel = ["medic",_animState] call fnc_inString;
if (_isRefuel) then {
_started = true;
};
if (_started and !_isRefuel) then {
r_doLoop = false;
_finished = true;
};
uiSleep 0.1;
};
r_doLoop = false;
_finished = ["Medic",1] call fn_loopAction;
if (_finished) then {
//Double check player did not drop any items
{
if !(_x in magazines player) exitWith {
format[localize "str_maintenanceMissingPart",_x,_displayname] call dayz_rollingMessages; //"Missing %1 to maintenance %2."
_startMaintenance = false;
};
} count _requiredParts;
if (!_startMaintenance) exitWith {};
{ player removeMagazine _x } count _requiredParts;
["Working",0,MAINTENANCE_NUTRITION_VALUES] call dayz_NutritionSystem; // Added Nutrition-Factor for work
PVDZ_veh_Save = [_cursorTarget,"maintenance"];
if (isServer) then {
PVDZ_veh_Save call server_updateObject;
@@ -106,10 +95,9 @@ if (_startMaintenance) then {
//PVDZ_object_replace = _cursorTarget;
//publicVariableServer "PVDZ_object_replace";
_cursorTarget setVariable["Maintenance",false,true];
localize "str_maintenanceDone" call dayz_rollingMessages;
};
_cursorTarget setVariable["Maintenance",false,true];
localize "str_maintenanceDone" call dayz_rollingMessages;
};
dayz_actionInProgress = false;

View File

@@ -11,8 +11,8 @@
*/
private ["_objclass","_cursorTarget","_item","_classname","_requiredTools","_requiredParts","_upgrade","_upgradeConfig",
"_upgradeDisplayname","_onLadder","_isWater","_upgradeParts","_startUpgrade","_missingPartsConfig","_textMissingParts","_dis",
"_sfx","_ownerID","_objectID","_objectUID","_alreadyupgrading","_dir","_weapons","_magazines","_backpacks",
"_object","_objWpnTypes","_objWpnQty","_countr","_itemName","_vector"];
"_sfx","_ownerID","_objectID","_objectUID","_dir","_weapons","_magazines","_backpacks",
"_object","_objWpnTypes","_objWpnQty","_countr","_itemName","_vector","_finished"];
_cursorTarget = _this select 0;
@@ -22,6 +22,9 @@ if ((isNil "_cursorTarget") or {(isNull _cursorTarget)}) then {
};
if (isNull _cursorTarget) exitWith {};
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
_item = typeof _cursorTarget;
//remove action menu
@@ -59,7 +62,7 @@ _isWater = (surfaceIsWater (getPosATL player)) or dayz_isSwimming;
_upgradeParts = [];
_startUpgrade = true;
if(_isWater or _onLadder) exitWith { localize "str_CannotUpgrade" call dayz_rollingMessages; };
if(_isWater or _onLadder) exitWith { localize "str_CannotUpgrade" call dayz_rollingMessages; dayz_actionInProgress = false; };
// lets check player has requiredTools for upgrade
{
@@ -89,12 +92,14 @@ if(_isWater or _onLadder) exitWith { localize "str_CannotUpgrade" call dayz_roll
//Does object have a upgrade option.
if ((_startUpgrade) AND (isClass(_upgradeConfig))) then {
//play animation
player playActionNow "Medic";
_dis = 20;
_sfx = "tentpack";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
//Double check player did not drop required parts
if (!_finished or (isNull _cursorTarget) or ({!(_x in magazines player)} count _upgradeParts > 0)) exitWith {};
// Added Nutrition-Factor for work
["Working",0,[100,15,5,0]] call dayz_NutritionSystem;
@@ -104,15 +109,6 @@ if ((_startUpgrade) AND (isClass(_upgradeConfig))) then {
_objectID = _cursorTarget getVariable ["ObjectID","0"];
_objectUID = _cursorTarget getVariable ["ObjectUID","0"];
//Upgrade
_alreadyupgrading = _cursorTarget getVariable["alreadyupgrading",0];
if (_alreadyupgrading == 1) exitWith { localize "str_upgradeInProgress" call dayz_rollingMessages; };
_cursorTarget setVariable["alreadyupgrading",1];
uiSleep 0.03;
//Get location and direction of old item
_dir = round getDir _cursorTarget;
_vector = [vectorDir _cursorTarget,vectorUp _cursorTarget];
@@ -126,9 +122,6 @@ if ((_startUpgrade) AND (isClass(_upgradeConfig))) then {
//get contents
_magazines = getMagazineCargo _cursorTarget;
//replay animation
player playActionNow "Medic";
deleteVehicle _cursorTarget;
// remove parts from players inventory before creation of new tent.
@@ -161,14 +154,10 @@ if ((_startUpgrade) AND (isClass(_upgradeConfig))) then {
_countr = _countr + 1;
} count _objWpnTypes;
uiSleep 3;
//Light fire
[_object,true] call dayz_inflame;
_object spawn player_fireMonitor;
//publish new tent
//[[[],[]],[[],[]],[[],[]]]
PVDZ_obj_Publish = [dayz_characterID,_object,[_dir, _pos],[[[],[]],_magazines,[[],[]]]];
publicVariableServer "PVDZ_obj_Publish";
diag_log [diag_ticktime, __FILE__, "New Networked object, request to save to hive. PVDZ_obj_Publish:", PVDZ_obj_Publish];
@@ -178,4 +167,6 @@ if ((_startUpgrade) AND (isClass(_upgradeConfig))) then {
} else {
localize "str_upgradeNoOption" call dayz_rollingMessages;
*/
};
};
dayz_actionInProgress = false;

View File

@@ -11,8 +11,8 @@ dayz_actionInProgress = true;
private ["_cursorTarget","_item","_classname","_requiredTools","_requiredParts","_upgrade","_upgradeConfig",
"_upgradeDisplayname","_onLadder","_isWater","_upgradeParts","_startUpgrade","_missingPartsConfig","_textMissingParts","_dis",
"_sfx","_ownerID","_objectID","_objectUID","_alreadyupgrading","_dir","_weapons","_magazines","_backpacks","_object",
"_objWpnTypes","_objWpnQty","_countr","_itemName","_vector","_playerNear"];
"_sfx","_ownerID","_objectID","_objectUID","_dir","_weapons","_magazines","_backpacks","_object",
"_objWpnTypes","_objWpnQty","_countr","_itemName","_vector","_playerNear","_finished"];
_cursorTarget = _this select 3;
@@ -98,24 +98,17 @@ if (_playerNear) exitWith {dayz_actionInProgress = false; localize "str_pickup_l
//Does object have a upgrade option.
if ((_startUpgrade) AND (isClass(_upgradeConfig))) then {
//play animation
player playActionNow "Medic";
_dis = 20;
_sfx = "tentpack";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
//Double check player did not drop required parts
if (!_finished or (isNull _cursorTarget) or ({!(_x in magazines player)} count _upgradeParts > 0)) exitWith {};
// Added Nutrition-Factor for work
["Working",0,[100,15,5,0]] call dayz_NutritionSystem;
//Upgrade
_alreadyupgrading = _cursorTarget getVariable["alreadyupgrading",0];
if (_alreadyupgrading == 1) exitWith { localize "str_upgradeInProgress" call dayz_rollingMessages; };
_cursorTarget setVariable["alreadyupgrading",1,true];
uiSleep 0.03;
//Get location and direction of old item
_dir = round getDir _cursorTarget;
@@ -134,9 +127,6 @@ if ((_startUpgrade) AND (isClass(_upgradeConfig))) then {
_magazines = getMagazineCargo _cursorTarget;
_backpacks = getBackpackCargo _cursorTarget;
//replay animation
player playActionNow "Medic";
//remove old tent
PVDZ_obj_Destroy = [_objectID,_objectUID,player];
publicVariableServer "PVDZ_obj_Destroy";
@@ -190,8 +180,6 @@ if ((_startUpgrade) AND (isClass(_upgradeConfig))) then {
_countr = _countr + 1;
} count _objWpnTypes;
uiSleep 3;
//publish new tent
if (DZE_permanentPlot) then {
_object setVariable ["ownerPUID",dayz_playerUID,true];

View File

@@ -9,7 +9,7 @@
private ["_nearByChoppers","_cursorTarget","_type","_class","_requiredTools","_requiredParts","_upgradeType","_producedParts","_randomCreate",
"_upgradeClass","_onLadder","_isWater","_ok","_missing","_upgradeParts","_dis","_characterID","_objectID","_objectUID",
"_ownerArray","_ownerPasscode","_dir","_vector","_object","_puid","_clanArray","_wh","_variables"];
"_ownerArray","_ownerPasscode","_dir","_vector","_object","_puid","_clanArray","_wh","_variables","_finished"];
_cursorTarget = _this;
// ArmaA2 bug workaround: sometimes the object is null
@@ -71,26 +71,25 @@ if (!_ok) exitWith {
{ player addMagazine _x; } foreach _upgradeParts;
format [localize "str_upgradeMissingPart", _missing] call dayz_rollingMessages;
};
//Upgrade Started
if ((player getVariable["alreadyBuilding",0]) == 1) exitWith {
{ player addMagazine _x; } foreach _upgradeParts;
localize "str_upgradeInProgress" call dayz_rollingMessages;
};
player setVariable["alreadyBuilding",1];
//play animation
player playActionNow "Medic";
if (dayz_actionInProgress) exitWith {
{ player addMagazine _x; } forEach _upgradeParts;
localize "str_player_actionslimit" call dayz_rollingMessages;
};
dayz_actionInProgress = true;
_dis=20;
[player,"tentpack",0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
if (!_finished) exitWith {
{ player addMagazine _x; } forEach _upgradeParts;
dayz_actionInProgress = false;
};
// Added Nutrition-Factor for work
["Working",0,[100,15,5,0]] call dayz_NutritionSystem;
//wait animation end
waitUntil {getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "disableWeapons") == 1};
waitUntil {getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "disableWeapons") == 0};
//get data from old building.
_characterID = _cursorTarget getVariable ["characterID","0"];
@@ -153,5 +152,5 @@ if (isServer) then {
player reveal _object;
//Make sure its unlocked
player setVariable["alreadyBuilding",0];
localize "str_upgradeDone" call dayz_rollingMessages;
localize "str_upgradeDone" call dayz_rollingMessages;
dayz_actionInProgress = false;

View File

@@ -1,11 +0,0 @@
private ["_array","_object","_type"];
_array = _this select 3;
_object = _array select 0;
_type = TypeOf(_object);
player playActionNow "Medic";
uiSleep 8;
player addBackpack format["%1_US_Bag_EP1",_type];
deleteVehicle _object;
r_action = false;
call fnc_usec_medic_removeActions;

View File

@@ -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;

View File

@@ -1,5 +1,5 @@
private ["_brokein","_isOk","_hasSledgeHammer","_gps","_vars","_hasToolbox","_hasCrowbar","_limit","_proceed","_counter",
"_dis","_sfx","_roll","_animState","_started","_finished","_isMedic","_isGate","_values"];
"_dis","_sfx","_roll","_finished","_isGate","_values"];
_target = _this select 3;
_pos = getPos _target;
@@ -51,40 +51,14 @@ while {_isOk} do {
uiSleep 1;
};
//Run animation
player playActionNow "Medic";
//Run SFX
_dis=20;
_sfx = "repair";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
//Setup Vars
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
//run animation loop
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
_finished = false;
};
uiSleep 0.1;
};
r_doLoop = false;
//Run animation loop
_finished = ["Medic",1] call fn_loopAction;
//Interrupt and end
if(!_finished) exitWith {
@@ -139,12 +113,6 @@ if (isnil "_proceed") exitwith {};
//Interrupted for some reason
if (!_proceed) then {
r_interrupt = false;
if (vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
localize "STR_BLD_BREAKIN_CANCELLED" call dayz_rollingMessages;
};

View File

@@ -4,7 +4,7 @@ if (!isNil "_this" && {typeName _this == "ARRAY"} && {count _this > 0}) exitWith
DayZ Base Building
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
private ["_location","_pos","_dir","_classname","_item","_cancel","_reason","_started","_finished","_animState","_isMedic","_dis","_sfx","_tmpbuilt","_onLadder","_require","_text","_offset","_isOk","_location1","_location2","_counter","_limit","_proceed","_num_removed","_position","_object","_canBuildOnPlot","_distance","_classnametmp","_ghost","_lockable","_zheightchanged","_rotate","_combination_1","_combination_2","_combination_3","_combination_4","_combination","_combination_1_Display","_combinationDisplay","_zheightdirection","_abort","_isNear","_needNear","_vehicle","_inVehicle","_objHDiff","_isAllowedUnderGround","_canBuild"];
private ["_location","_pos","_dir","_classname","_item","_cancel","_reason","_finished","_dis","_sfx","_tmpbuilt","_onLadder","_require","_text","_offset","_isOk","_location1","_location2","_counter","_limit","_proceed","_num_removed","_position","_object","_canBuildOnPlot","_distance","_classnametmp","_ghost","_lockable","_zheightchanged","_rotate","_combination_1","_combination_2","_combination_3","_combination_4","_combination","_combination_1_Display","_combinationDisplay","_zheightdirection","_abort","_isNear","_needNear","_vehicle","_inVehicle","_objHDiff","_isAllowedUnderGround","_canBuild"];
if (dayz_actionInProgress) exitWith {localize "str_epoch_player_40" call dayz_rollingMessages;};
dayz_actionInProgress = true;
@@ -324,41 +324,14 @@ if (_canBuild select 0) then {
_counter = 0;
while {_isOk} do {
format[localize "str_epoch_player_139",_text, (_counter + 1),_limit] call dayz_rollingMessages;
player playActionNow "Medic";
_dis=20;
_sfx = "repair";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
r_interrupt = false;
r_doLoop = true;
_started = false;
_finished = false;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt || (player getVariable["combattimeout",0] >= diag_tickTime)) then {
r_doLoop = false;
};
if (DZE_cancelBuilding) exitWith {
r_doLoop = false;
};
uiSleep 0.1;
};
r_doLoop = false;
_finished = ["Medic",1,{player getVariable["combattimeout",0] >= diag_tickTime or DZE_cancelBuilding}] call fn_loopAction;
if(!_finished) exitWith {
_isOk = false;
@@ -373,7 +346,6 @@ if (_canBuild select 0) then {
_isOk = false;
_proceed = true;
};
};
if (_proceed) then {
@@ -477,14 +449,7 @@ if (_canBuild select 0) then {
localize "str_epoch_player_46" call dayz_rollingMessages;
};
} else {
r_interrupt = false;
if (vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
deleteVehicle _tmpbuilt;
localize "str_epoch_player_46" call dayz_rollingMessages;
};
} else {

View File

@@ -11,6 +11,9 @@ private ["_classType","_item","_action","_missingTools","_missingItem","_emergin
Needs a full rewrite to keep up with the demand of everything we plan to add.
*/
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
call gear_ui_init;
closeDialog 1;
@@ -25,7 +28,6 @@ if (count _this > 2) then {
};
_emergingLevel = 1.1;
dayz_actionInProgress = true;
_isClass = switch (1==1) do {
case (isClass (configFile >> "CfgMagazines" >> _item)): {"CfgMagazines"};
@@ -52,12 +54,9 @@ _keepOnSlope = 0 == (getNumber (configFile >> "CfgVehicles" >> _classname >> "ca
_onLadder = {getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder") == 1};
_isWater = {(surfaceIsWater (getPosATL _object)) or dayz_isSwimming};
if (0 != count Dayz_constructionContext) then {
if (0 != count Dayz_constructionContext) exitWith {
dayz_actionInProgress = false;
//cutText [localize "str_already_building", "PLAIN DOWN"];
_msg = localize "str_already_building";
_msg call dayz_rollingMessages;
diag_log [ diag_ticktime, __FILE__, 'already building, exiting', Dayz_constructionContext, typeName Dayz_constructionContext];
localize "str_already_building" call dayz_rollingMessages;
};
// item is missin - this really is pointless but it aint broke so dont fix it
@@ -297,7 +296,7 @@ _position = getPosATL _object;
_actionBuildHidden = true;
_actionCancel = player addAction [localize "str_player_build_cancel", "\z\addons\dayz_code\actions\object_build.sqf", [_object, _requiredParts, _classname, _text, false, 0, "none"], 1, true, true, "", "0 != count Dayz_constructionContext"];
while {dayz_actionInProgress and Dayz_constructionContext select 4} do {
while {Dayz_constructionContext select 4} do {
// force the angle so that the ghost is showing always the same side
_angleRef=Dayz_constructionContext select 1;

View File

@@ -2,7 +2,7 @@
DayZ Base Building Upgrades
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
private ["_location","_dir","_classname","_text","_object","_objectID","_objectUID","_newclassname","_refund","_obj","_upgrade","_objectCharacterID","_ownerID","_i","_invResult","_itemOut","_countOut","_abortInvAdd","_addedItems"];
private ["_location","_dir","_classname","_text","_object","_objectID","_objectUID","_newclassname","_refund","_obj","_upgrade","_objectCharacterID","_ownerID","_i","_invResult","_itemOut","_countOut","_abortInvAdd","_addedItems","_finished"];
if (dayz_actionInProgress) exitWith {localize "str_epoch_player_48" call dayz_rollingMessages;};
dayz_actionInProgress = true;
@@ -37,13 +37,15 @@ _text = getText (configFile >> "CfgVehicles" >> _classname >> "displayName");
_upgrade = getArray (configFile >> "CfgVehicles" >> _classname >> "downgradeBuilding");
if ((count _upgrade) > 0) then {
_newclassname = _upgrade select 0;
_refund = _upgrade select 1;
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
player playActionNow "Medic";
[player,20,true,(getPosATL player)] spawn player_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
if (!_finished) exitWith {};
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
_invResult = false;
_abortInvAdd = false;

View File

@@ -2,7 +2,7 @@
DayZ Base Building Maintenance
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
private ["_location","_dir","_classname","_missing","_text","_proceed","_num_removed","_object","_missingQty","_itemIn","_countIn","_qty","_removed","_removed_total","_tobe_removed_total","_objectID","_objectUID","_temp_removed_array","_textMissing","_requirements","_obj","_upgrade","_objectCharacterID"];
private ["_location","_dir","_classname","_missing","_text","_proceed","_num_removed","_object","_missingQty","_itemIn","_countIn","_qty","_removed","_removed_total","_tobe_removed_total","_objectID","_objectUID","_temp_removed_array","_textMissing","_requirements","_obj","_upgrade","_objectCharacterID","_finished"];
if (dayz_actionInProgress) exitWith {localize "str_epoch_player_52" call dayz_rollingMessages;};
dayz_actionInProgress = true;
@@ -47,10 +47,13 @@ _proceed = true;
if(_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} forEach _requirements;
if (_proceed) then {
["Working",0,[20,40,15,0]] call dayz_NutritionSystem;
player playActionNow "Medic";
if (_proceed) then {
[player,20,true,(getPosATL player)] spawn player_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
if (!_finished) exitWith {};
["Working",0,[20,40,15,0]] call dayz_NutritionSystem;
_temp_removed_array = [];
_removed_total = 0;
@@ -89,6 +92,5 @@ if (_proceed) then {
format[localize "STR_EPOCH_ACTIONS_6",_missingQty, _textMissing] call dayz_rollingMessages;
};
dayz_actionInProgress = false;
s_player_maint_build = -1;

View File

@@ -1,5 +1,5 @@
private ["_dis","_sfx","_breaking","_countOut","_counter","_isOk","_proceed","_animState","_started","_finished","_isMedic","_itemOut","_tree","_distance2d"];
private ["_dis","_sfx","_breaking","_countOut","_counter","_isOk","_proceed","_finished","_itemOut","_tree","_distance2d"];
call gear_ui_init;
closeDialog 1;
@@ -26,41 +26,18 @@ if (!isNull _tree) then {
_proceed = false;
while {_isOk} do {
//play action
player playActionNow "Medic";
//setup alert and speak
_dis=20;
_sfx = "chopwood";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
//play action
_finished = ["Medic",1] call fn_loopAction;
// Working-Factor for chopping wood.
["Working",0,[50,10,5,0]] call dayz_NutritionSystem;
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
};
uiSleep 0.1;
};
if(!_finished) exitWith {
_isOk = false;
_proceed = false;
@@ -118,13 +95,6 @@ if (!isNull _tree) then {
};
if !(_proceed) then {
localize "str_player_24_Stoped" call dayz_rollingMessages;
r_interrupt = false;
if (vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
};
//adding melee mags back if needed
switch (primaryWeapon player) do {

View File

@@ -1,4 +1,4 @@
private ["_item","_config","_pos","_onLadder","_create","_started","_finished","_animState","_isMedic","_num_removed","_text","_haskey","_hastoolweapon","_isNear","_hasTinBar"];
private ["_item","_config","_pos","_onLadder","_create","_finished","_num_removed","_text","_haskey","_hastoolweapon","_isNear","_hasTinBar"];
if (dayz_actionInProgress) exitWith {localize "str_epoch_player_56" call dayz_rollingMessages;};
dayz_actionInProgress = true;
@@ -25,36 +25,13 @@ call gear_ui_init;
// require one tin bar per key
_hasTinBar = "ItemTinBar" in magazines player;
if (!_hasTinBar) exitWith {dayz_actionInProgress = false; localize "str_epoch_player_59" call dayz_rollingMessages;};
player playActionNow "Medic";
[player,"repair",0,false] call dayz_zombieSpeak;
[player,50,true,_pos] spawn player_alertZombies;
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
};
uiSleep 0.1;
};
r_doLoop = false;
if(_finished) then {
_finished = ["Medic",1] call fn_loopAction;
if (_finished) then {
_num_removed = ([player,"ItemTinBar"] call BIS_fnc_invRemove);
if(_num_removed == 1) then {
@@ -64,11 +41,6 @@ if(_finished) then {
localize "str_epoch_player_61" call dayz_rollingMessages;
};
} else {
r_interrupt = false;
if (vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
localize "str_epoch_player_61" call dayz_rollingMessages;
};
dayz_actionInProgress = false;

View File

@@ -23,7 +23,7 @@ class ItemActions
};
};
*/
private ["_tradeComplete","_onLadder","_canDo","_selectedRecipeOutput","_boiled","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_started","_finished","_animState","_isMedic","_removed","_tobe_removed_total","_textCreate","_textMissing","_selectedRecipeInput","_selectedRecipeInputStrict","_num_removed","_removed_total","_temp_removed_array","_abort","_waterLevel","_waterLevel_lowest","_reason","_isNear","_selectedRecipeTools","_distance","_crafting","_needNear","_item","_baseClass","_num_removed_weapons","_outputWeapons","_inputWeapons","_randomOutput","_craft_doLoop","_selectedWeapon","_selectedMag","_sfx"];
private ["_tradeComplete","_onLadder","_canDo","_selectedRecipeOutput","_boiled","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_finished","_removed","_tobe_removed_total","_textCreate","_textMissing","_selectedRecipeInput","_selectedRecipeInputStrict","_num_removed","_removed_total","_temp_removed_array","_abort","_waterLevel","_waterLevel_lowest","_reason","_isNear","_selectedRecipeTools","_distance","_crafting","_needNear","_item","_baseClass","_num_removed_weapons","_outputWeapons","_inputWeapons","_randomOutput","_craft_doLoop","_selectedWeapon","_selectedMag","_sfx"];
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
@@ -113,33 +113,10 @@ if (_canDo) then {
if (_proceed) then {
localize "str_epoch_player_62" call dayz_rollingMessages;
player playActionNow "Medic";
[player,_sfx,0,false] call dayz_zombieSpeak;
[player,50,true,(getPosATL player)] spawn player_alertZombies;
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
};
uiSleep 0.1;
};
r_doLoop = false;
_finished = ["Medic",1] call fn_loopAction;
if (_finished) then {
_removed_total = 0; // count total of removed items
@@ -254,11 +231,6 @@ if (_canDo) then {
};
} else {
r_interrupt = false;
if (vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
localize "str_epoch_player_64" call dayz_rollingMessages;
_craft_doLoop = false;
};

View File

@@ -10,7 +10,7 @@
failChance = 1;
*/
//diag_log("crafting system");
private ["_config","_input","_output","_required","_failChance","_hasInput","_availabeSpace","_classname","_isClass","_onLadder","_hasTools","_avail","_selection","_item","_amount","_itemName","_freeSlots","_slotType","_i","_j","_dis","_sfx"];
private ["_config","_input","_output","_required","_failChance","_hasInput","_availabeSpace","_classname","_isClass","_onLadder","_hasTools","_avail","_selection","_item","_amount","_itemName","_freeSlots","_slotType","_i","_j","_dis","_sfx","_finished"];
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
@@ -129,14 +129,15 @@ if(!r_drag_sqf and !r_player_unconscious and !_onLadder) then {
//player playActionNow "PutDown";
call gear_ui_init;
closeDialog 1;
player playActionNow "Medic";
uiSleep 2;
//setup alert and speak
_dis=20;
_sfx = if (_classname == "equip_rope") then {"bandage"} else {"chopwood"};
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
if (!_finished) exitWith {};
{
_item = _x select 0;
_amount = _x select 2;
@@ -155,7 +156,7 @@ if(!r_drag_sqf and !r_player_unconscious and !_onLadder) then {
//uiSleep 0.1;
};
} forEach _input;
uiSleep 3;
{
_item = _x select 0;
_selection = _x select 1;

View File

@@ -1,4 +1,4 @@
private ["_playerPos","_item","_location","_config","_text","_dir","_dis","_sfx","_consumetext","_stashname","_stashtype","_stash","_consume","_hasitemcount","_worldspace"];
private ["_playerPos","_item","_location","_config","_text","_dir","_dis","_sfx","_consumetext","_stashname","_stashtype","_stash","_consume","_hasitemcount","_worldspace","_finished"];
//check if can pitch here
call gear_ui_init;
@@ -45,16 +45,16 @@ if ((count _worldspace) == 2) then {
player removeMagazine _consume;
_dir = round(direction player);
//wait a bit
player playActionNow "Medic";
uiSleep 1;
_dis=20;
_sfx = "tentunpack";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
if (!_finished) exitWith {
player addMagazine _consume;
};
uiSleep 5;
//place tent (local)
_stash = createVehicle [_stashtype, _location, [], 0, "CAN_COLLIDE"];
_stash setdir _dir;

View File

@@ -1,4 +1,4 @@
private ["_emptycan","_objectID","_objectUID","_obj","_fuelArray","_matchArray","_alreadyDestroying","_randomJerryCan","_fireIntensity","_dis","_sfx"];
private ["_emptycan","_objectID","_objectUID","_obj","_fuelArray","_matchArray","_randomJerryCan","_fireIntensity","_dis","_sfx","_finished"];
//Tent Object
_obj = _this select 3;
@@ -27,19 +27,22 @@ _matchArray = [];
if ((count _fuelArray == 0)) exitwith { systemChat (localize ("str_setFireFuel")); };
if ((count _matchArray == 0)) exitwith { systemChat (localize ("str_setFireMatches")); };
//Play normal action animation
player playActionNow "Medic";
if (dayz_actionInProgress) exitWith { localize "str_player_actionslimit" call dayz_rollingMessages; };
dayz_actionInProgress = true;
//Actionmenu tools
player removeAction s_player_destroytent;
s_player_destroytent = -1;
//Make sure you can only destroy once
_alreadyDestroying = _obj getVariable["alreadyDestroying",0];
_dis=20;
_sfx = "tentpack";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
if (_alreadyDestroying == 1) exitWith {localize "str_TentAlreadyLit" call dayz_rollingMessages;};
_obj setVariable["alreadyDestroying",1];
_finished = ["Medic",1] call fn_loopAction;
if (!_finished or (isNull _obj)) exitWith {
dayz_actionInProgress = false;
};
//Jerry can system ** Needs redoing
//Select random can from array
@@ -49,24 +52,20 @@ _name = getText (configFile >> "CfgMagazines" >> _randomJerryCan >> "displayName
_emptycan = getText (configFile >> "CfgMagazines" >> _randomJerryCan >> "emptycan");
_fireIntensity = getNumber (configFile >> "CfgMagazines" >> _randomJerryCan >> "fireIntensity");
if !(_randomJerryCan in magazines player) exitWith {
localize "str_setFireFuel" call dayz_rollingMessages;
dayz_actionInProgress = false;
};
player removeMagazine _randomJerryCan;
player addMagazine _emptycan;
["matches",0.3] call fn_dynamicTool;
//Normal alerts
_dis=20;
_sfx = "tentpack";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
// Added Nutrition-Factor for work
["Working",0,[20,40,15,0]] call dayz_NutritionSystem;
uiSleep 3;
_activatingPlayer = player;
PVDZ_obj_Destroy = [_objectID,_objectUID, _activatingPlayer];
PVDZ_obj_Destroy = [_objectID,_objectUID,player];
publicVariableServer "PVDZ_obj_Destroy";
//Send killed for object
@@ -86,4 +85,5 @@ publicVariable "PVDZ_obj_Fire";
_obj inflame true;
//_obj spawn player_fireMonitor;
localize "str_success_tent_destroyed" call dayz_rollingMessages;
localize "str_success_tent_destroyed" call dayz_rollingMessages;
dayz_actionInProgress = false;

View File

@@ -1,21 +1,30 @@
private ["_bottle","_tape","_fixedBottle"];
private ["_bottle","_tape","_fixedBottle","_finished"];
_bottle = _this;
_tape = "equip_duct_tape";
_fixedBottle = "ItemWaterBottleUnfilled";
if (dayz_actionInProgress) exitWith { localize "str_player_actionslimit" call dayz_rollingMessages; };
dayz_actionInProgress = true;
call gear_ui_init;
closeDialog 0;
// Check if the player has the tape
if (_tape in magazines player) then {
//Fix the bottle
player playActionNow "Medic";
[player,"bandage",0,false] call dayz_zombieSpeak;
uiSleep 6;
player removeMagazine _bottle;
player removeMagazine _tape;
player addMagazine _fixedBottle;
localize "str_fix_water_bottle" call dayz_rollingMessages;
[player,"bandage",0,false] call dayz_zombieSpeak;
_finished = ["Medic",1] call fn_loopAction;
if (!_finished) exitWith {};
// Check again to make sure player didn't drop item
if (_tape in magazines player) then {
player removeMagazine _bottle;
player removeMagazine _tape;
player addMagazine _fixedBottle;
localize "str_fix_water_bottle" call dayz_rollingMessages;
};
} else { //If the player doesn't have the tape
localize "str_fix_water_bottle_fail" call dayz_rollingMessages;
};
};
dayz_actionInProgress = false;

View File

@@ -1,5 +1,5 @@
//fixHatchet old file
private ["_tool","_tape","_fixedItem","_config","_dName","_handle"];
private ["_tool","_tape","_fixedItem","_config","_dName","_handle","_finished"];
_tool = _this;
_config = configFile >> "CfgWeapons" >> _tool;
@@ -12,21 +12,26 @@ _tape = "equip_duct_tape";
//Handle
_handle = "equip_lever";
if (dayz_actionInProgress) exitWith { localize "str_player_actionslimit" call dayz_rollingMessages; };
dayz_actionInProgress = true;
call gear_ui_init;
closeDialog 0;
// Check if the player has the tape
if ((_tape in magazines player) && (_handle in magazines player)) then {
//Fix the tool
player playActionNow "Medic";
if ((_tape in magazines player) && (_handle in magazines player) && (_tool in items player)) then {
[player,"bandage",0,false] call dayz_zombieSpeak;
uiSleep 6;
player removeWeapon _tool;
player removeMagazine _tape;
player removeMagazine _handle;
player addWeapon _fixedItem;
format[localize "str_fixToolSuccess", _dName] call dayz_rollingMessages;
_finished = ["Medic",1] call fn_loopAction;
if (!_finished) exitWith {};
// Check again to make sure player didn't drop item
if ((_tape in magazines player) && (_handle in magazines player) && (_tool in items player)) then {
player removeWeapon _tool;
player removeMagazine _tape;
player removeMagazine _handle;
player addWeapon _fixedItem;
format[localize "str_fixToolSuccess", _dName] call dayz_rollingMessages;
};
} else { //If the player doesn't have the mats.
if (!(_tape in magazines player)) then {
if (!(_handle in magazines player)) then {
@@ -37,4 +42,6 @@ if ((_tape in magazines player) && (_handle in magazines player)) then {
} else {
localize "str_fixtoolMissingHandle" call dayz_rollingMessages;
};
};
};
dayz_actionInProgress = false;

View File

@@ -3,7 +3,7 @@
Usage: spawn player_harvestPlant;
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
private ["_isOk","_i","_objName","_started","_finished","_animState","_isMedic","_proceed","_itemOut","_countOut","_plant","_findNearestPlant","_index","_invResult","_text","_playerNear"];
private ["_isOk","_i","_objName","_finished","_proceed","_itemOut","_countOut","_plant","_findNearestPlant","_index","_invResult","_text","_playerNear"];
if (dayz_actionInProgress) exitWith {localize "str_epoch_player_72" call dayz_rollingMessages;};
dayz_actionInProgress = true;
@@ -31,34 +31,11 @@ if (count _findNearestPlant >= 1) then {
_isOk = true;
_proceed = false;
while {_isOk} do {
player playActionNow "Medic";
[player,20,true,(getPosATL player)] spawn player_alertZombies;
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
[player,"chopwood",0,false] call dayz_zombieSpeak;
};
if (r_interrupt) then {
r_doLoop = false;
};
[player,"chopwood",0,false] call dayz_zombieSpeak;
uiSleep 0.1;
_finished = ["Medic",1] call fn_loopAction;
};
if(!_finished) exitWith {
_isOk = false;
_proceed = false;
@@ -103,11 +80,6 @@ if (count _findNearestPlant >= 1) then {
format[localize "str_epoch_player_143",_i,_text] call dayz_rollingMessages;
};
} else {
r_interrupt = false;
if (vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
localize "str_epoch_player_73" call dayz_rollingMessages;
};
} else {

View File

@@ -1,4 +1,4 @@
private ["_dir","_classname","_b0x1337","_location","_item","_config","_create_raw","_create","_qty","_type","_hasCrate","_hasTool"];
private ["_dir","_classname","_b0x1337","_location","_item","_config","_create_raw","_create","_qty","_type","_hasCrate","_hasTool","_finished"];
if (dayz_actionInProgress) exitWith {localize "str_epoch_player_75" call dayz_rollingMessages;};
dayz_actionInProgress = true;
@@ -27,6 +27,11 @@ if ((_location select 2) < 0) then {
_location set [2,0];
};
_finished = ["Medic",1] call fn_loopAction;
if (!_finished or !(_item in magazines player)) exitWith {
dayz_actionInProgress = false;
};
//remove (partially) full crate
player removeMagazine _item;
_dir = getDir player;
@@ -36,9 +41,6 @@ _classname = "WeaponHolder";
player addMagazine "bulk_empty";
["Working",0,[20,40,15,0]] call dayz_NutritionSystem;
// Change to optional wait to complete
player playActionNow "Medic";
uiSleep 6;
_b0x1337 = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
_b0x1337 setDir _dir;

View File

@@ -1,9 +1,12 @@
private ["_item","_config","_exit","_text","_booleans","_worldspace","_dir","_location","_dis","_fire","_tool","_itemPile","_posASL","_testSea"];
private ["_item","_config","_exit","_text","_booleans","_worldspace","_dir","_location","_fire","_tool","_itemPile","_posASL","_testSea","_finished"];
_tool = _this;
call gear_ui_init;
closeDialog 0;
if (dayz_actionInProgress) exitWith { localize "str_player_actionslimit" call dayz_rollingMessages; };
dayz_actionInProgress = true;
_item = "ItemLog";
_itemPile = "PartWoodPile";
_config = configFile >> "CfgMagazines" >> _item;
@@ -14,19 +17,25 @@ if (_tool == "PartWoodPile") then {
_exit = true;
{if (_x in DayZ_Ignitors) exitWith {_exit = false};} forEach (items player);
};
if (_exit) exitWith {(localize "str_fireplace_noMatches") call dayz_rollingMessages;};
if (_exit) exitWith {
localize "str_fireplace_noMatches" call dayz_rollingMessages;
dayz_actionInProgress = false;
};
// item is missing or tools are missing
if (!(_item in magazines player) && !(_itemPile in magazines player)) exitWith {
//localize "str_player_22" call dayz_rollingMessages;
(localize "str_player_22") call dayz_rollingMessages;
localize "str_player_22" call dayz_rollingMessages;
dayz_actionInProgress = false;
};
_booleans = []; //testonLadder, testSea, testPond, testBuilding, testSlope, testDistance
_worldspace = ["Land_Fire_DZ", player, _booleans] call fn_niceSpot;
// player on ladder or in a vehicle
if (_booleans select 0) exitWith { localize "str_player_21" call dayz_rollingMessages; };
if (_booleans select 0) exitWith {
localize "str_player_21" call dayz_rollingMessages;
dayz_actionInProgress = false;
};
_testSea = true;
_posASL = getPosASL player;
@@ -37,9 +46,17 @@ if ((_booleans select 1) && _posASL select 2 > 2) then {
};
// object would be in the water (pool or sea)
if ((_booleans select 1 && _testSea) OR (_booleans select 2)) exitWith { localize "str_player_26" call dayz_rollingMessages; };
if ((_booleans select 1 && _testSea) OR (_booleans select 2)) exitWith {
localize "str_player_26" call dayz_rollingMessages;
dayz_actionInProgress = false;
};
if ((count _worldspace) == 2) then {
[player,20,true,(getPosATL player)] call player_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
if (!_finished or (!(_item in magazines player) && !(_itemPile in magazines player))) exitWith {};
if (_item in magazines player) then {
player removeMagazine _item;
} else {
@@ -48,19 +65,12 @@ if ((count _worldspace) == 2) then {
_dir = _worldspace select 0;
_location = _worldspace select 1;
player playActionNow "Medic";
uiSleep 1;
// fireplace location may not be in front of player (but in 99% time it should)
player setDir _dir;
player setPosATL (getPosATL player);
_dis=20;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
// Added Nutrition-Factor for work
["Working",0,[20,40,15,0]] call dayz_NutritionSystem;
uiSleep 5;
_fire = createVehicle ["Land_Fire_DZ", [0,0,0], [], 0, "CAN_COLLIDE"];
_fire setDir _dir;
@@ -82,4 +92,6 @@ if ((count _worldspace) == 2) then {
localize "str_fireplace_01" call dayz_rollingMessages;
} else {
localize "str_fireplace_02" call dayz_rollingMessages;
};
};
dayz_actionInProgress = false;

View File

@@ -1,12 +1,11 @@
private ["_item","_result","_dis","_sfx","_num","_breaking","_counter","_rocks","_findNearestRock",
"_objName","_countOut","_isOk","_proceed","_animState","_started","_finished","_isMedic","_itemOut","_wpPos","_nearByPile"];
private ["_item","_dis","_sfx","_breaking","_counter","_rocks","_findNearestRock","_objName","_countOut","_isOk","_proceed","_finished","_itemOut"];
_item = _this;
call gear_ui_init;
closeDialog 1;
if(dayz_workingInprogress) exitWith { localize "STR_MINING_IN_PROGRESS" call dayz_rollingMessages; };
dayz_workingInprogress = true;
if (dayz_actionInProgress) exitWith { localize "str_player_actionslimit" call dayz_rollingMessages; };
dayz_actionInProgress = true;
// allowed rocks list move this later
_rocks = ["r2_boulder1.p3d","r2_boulder2.p3d","r2_rock1.p3d","r2_rock2.p3d","r2_rocktower.p3d","r2_rockwall.p3d","r2_stone.p3d"];
@@ -22,56 +21,28 @@ _findNearestRock = objNull;
if (!isNull _findNearestRock) then {
_countOut = 2 + floor(random 3);
//Remove melee magazines (BIS_fnc_invAdd fix) (add new melee ammo to array if needed)
{player removeMagazines _x} forEach ["Hatchet_Swing","Crowbar_Swing","Machete_Swing","Fishing_Swing","Sledge_Swing"];
// Start stone mining loop
_counter = 0;
_isOk = true;
_proceed = false;
while {_isOk} do {
//play action
player playActionNow "Medic";
//setup alert and speak
_dis=20;
_sfx = "minestone";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
// Working-Factor for mining stone.
["Working",0,[100,15,10,0]] call dayz_NutritionSystem;
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
};
uiSleep 0.1;
};
_finished = ["Medic",1] call fn_loopAction;
if(!_finished) exitWith {
_isOk = false;
_proceed = false;
};
if(_finished) then {
if(_finished) then {
["Working",0,[100,15,10,0]] call dayz_NutritionSystem;
_breaking = false;
if (dayz_toolBreaking && {[0.09] call fn_chance}) then {
_breaking = true;
@@ -106,32 +77,15 @@ if (!isNull _findNearestRock) then {
};
_isOk = false;
_proceed = true;
uiSleep 1;
};
format[localize "str_mining_progress", _counter,(_countOut - _counter)] call dayz_rollingMessages;
};
if (!_proceed) then {
localize "str_mining_canceled" call dayz_rollingMessages;
r_interrupt = false;
if (vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
};
//adding melee mags back if needed
switch (primaryWeapon player) do {
case "MeleeHatchet": {player addMagazine 'Hatchet_Swing';};
case "MeleeCrowbar": {player addMagazine 'Crowbar_Swing';};
case "MeleeMachete": {player addMagazine 'Machete_Swing';};
case "MeleeFishingPole": {player addMagazine 'Fishing_Swing';};
case "MeleeSledge": {player addMagazine 'Sledge_Swing';};
};
} else {
localize "str_mining_no_rocks" call dayz_rollingMessages;
};
dayz_workingInprogress = false;
dayz_actionInProgress = false;

View File

@@ -1,4 +1,4 @@
private ["_skin","_rnd","_rounded","_itemtocreate","_i","_config","_result"];
private ["_skin","_rnd","_rounded","_itemtocreate","_i","_config","_result","_finished"];
_skin = _this;
_config = configFile >> "CfgMagazines" >> _skin;
@@ -9,11 +9,20 @@ _rounded = round _rnd;
call gear_ui_init;
closeDialog 0;
if (dayz_actionInProgress) exitWith { localize "str_player_actionslimit" call dayz_rollingMessages; };
dayz_actionInProgress = true;
//Tear the clothes
player playActionNow "Medic";
[player,"bandage",0,false] call dayz_zombieSpeak;
uiSleep 6;
if !(_skin in magazines player) exitWith {localize "str_tear_clothes_0" call dayz_rollingMessages;};
_finished = ["Medic",1] call fn_loopAction;
if (!_finished) exitWith {
dayz_actionInProgress = false;
};
if !(_skin in magazines player) exitWith {
localize "str_tear_clothes_0" call dayz_rollingMessages;
dayz_actionInProgress = false;
};
player removeMagazine _skin;
switch (_rounded) do {
@@ -48,4 +57,6 @@ while {_i < _rounded} do {
[_itemtocreate,1,1] call fn_dropItem;
};
};
true call dz_fn_meleeMagazines;
true call dz_fn_meleeMagazines;
dayz_actionInProgress = false;

View File

@@ -2,7 +2,7 @@
DayZ Base Building Upgrades
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
private ["_location","_dir","_classname","_missing","_text","_proceed","_num_removed","_object","_missingQty","_itemIn","_countIn","_qty","_removed","_removed_total","_tobe_removed_total","_objectID","_objectUID","_temp_removed_array","_textMissing","_newclassname","_requirements","_obj","_upgrade","_lockable","_combination_1","_combination_2","_combination_3","_combination","_objectCharacterID","_ownerID","_qtyBP","_forEachIndex","_bpMags","_countNew","_bp2Remove","_count","_friendsArr","_vector","_temp_BP_removed_array"];
private ["_location","_dir","_classname","_missing","_text","_proceed","_num_removed","_object","_missingQty","_itemIn","_countIn","_qty","_removed","_removed_total","_tobe_removed_total","_objectID","_objectUID","_temp_removed_array","_textMissing","_newclassname","_requirements","_obj","_upgrade","_lockable","_combination_1","_combination_2","_combination_3","_combination","_objectCharacterID","_ownerID","_qtyBP","_forEachIndex","_bpMags","_countNew","_bp2Remove","_count","_friendsArr","_vector","_temp_BP_removed_array","_finished"];
if (dayz_actionInProgress) exitWith {localize "str_epoch_player_52" call dayz_rollingMessages;};
dayz_actionInProgress = true;
@@ -51,9 +51,10 @@ if ((count _upgrade) > 0) then {
} forEach _requirements;
if (_proceed) then {
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
player playActionNow "Medic";
[player,20,true,(getPosATL player)] spawn player_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
if (!_finished) exitWith {};
["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
_temp_removed_array = [];
_temp_BP_removed_array = [];

View File

@@ -4,7 +4,7 @@ dayz_actionInProgress = true;
delete object from db with extra waiting by [VB]AWOL
parameters: _obj
*/
private ["_obj","_objectID","_objectUID","_started","_finished","_animState","_isMedic","_isOk","_proceed","_counter","_limit","_objType","_sfx","_dis","_itemOut","_countOut","_selectedRemoveOutput","_nearestPole","_ownerID","_refundpart","_isWreck","_IsNearPlot","_brokenTool","_removeTool","_isDestructable","_isRemovable","_objOwnerID","_isOwnerOfObj","_preventRefund","_ipos","_item","_radius","_isWreckBuilding","_nameVehicle","_isModular","_success","_lootGroupIndex","_output"];
private ["_obj","_objectID","_objectUID","_finished","_isOk","_proceed","_counter","_limit","_objType","_itemOut","_countOut","_selectedRemoveOutput","_nearestPole","_ownerID","_refundpart","_isWreck","_IsNearPlot","_brokenTool","_removeTool","_isDestructable","_isRemovable","_objOwnerID","_isOwnerOfObj","_preventRefund","_ipos","_item","_radius","_isWreckBuilding","_nameVehicle","_isModular","_success","_lootGroupIndex","_output"];
player removeAction s_player_deleteBuild;
s_player_deleteBuild = 1;
@@ -92,35 +92,8 @@ while {_isOk} do {
format[localize "str_epoch_player_163",_nameVehicle,(_counter + 1),_limit] call dayz_rollingMessages;
player playActionNow "Medic";
_dis=20;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
_sfx = "repair";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
};
if (r_interrupt) then {
r_doLoop = false;
};
uiSleep 0.1;
};
[player,"repair",0,false,20] call dayz_zombieSpeak;
_finished = ["Medic",1] call fn_loopAction;
if(!_finished) exitWith {
_isOk = false;
@@ -277,13 +250,6 @@ if (_proceed && _success) then {
} else {
localize "str_epoch_player_91" call dayz_rollingMessages;
};
} else {
r_interrupt = false;
if (vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
};
dayz_actionInProgress = false;
s_player_deleteBuild = -1;

View File

@@ -1,6 +1,6 @@
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_array","_vehicle","_part","_hitpoint","_type","_hasToolbox","_section","_nameType","_namePart","_damage","_selection","_dis","_sfx","_hitpoints","_allFixed","__FILE__"];
private ["_array","_vehicle","_part","_hitpoint","_type","_nameType","_namePart","_damage","_selection","_dis","_sfx","_hitpoints","_allFixed","_finished"];
_id = _this select 2;
_array = _this select 3;
@@ -15,28 +15,25 @@ dayz_myCursorTarget = objNull;
//diag_log(format["%1 %2", __FILE__, _this]);
_hasToolbox = "ItemToolbox" in items player;
_section = _part in magazines player;
//moving this here because we need to know which part needed if we don't have it
_nameType = getText(configFile >> "cfgVehicles" >> _type >> "displayName");
_namePart = getText(configFile >> "cfgMagazines" >> _part >> "displayName");
if (_section and _hasToolbox) then {
player removeMagazine _part;
player playActionNow "Medic";
sleep 1;
if ("ItemToolbox" in items player && (_part in magazines player)) then {
_dis=20;
_sfx = "repair";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
// Check again to make sure player did not drop item
if (!_finished or !(_part in magazines player)) exitWith {};
player removeMagazine _part;
// Added Nutrition-Factor for work
["Working",0,[20,40,15,0]] call dayz_NutritionSystem;
sleep 5;
_damage = [_vehicle,_hitpoint] call object_getHit;
_vehicle removeAction _id;
//dont waste loot on undamaged parts

View File

@@ -1,7 +1,7 @@
private ["_array","_vehicle","_part","_hitpoint","_type","_isOK","_brokenPart","_cancel","_started","_finished","_hasToolbox","_nameType","_namePart","_animState","_isMedic","_damage","_BreakableParts","_selection","_wpn","_classname","_ismelee"];
private ["_array","_vehicle","_part","_hitpoint","_type","_isOK","_brokenPart","_cancel","_finished","_hasToolbox","_nameType","_namePart","_damage","_BreakableParts","_selection","_wpn","_classname","_ismelee"];
if (dayz_salvageInProgress) exitWith { localize "str_salvage_inprogress" call dayz_rollingMessages; };
dayz_salvageInProgress = true;
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
_array = _this select 3;
_vehicle = _array select 0;
@@ -10,8 +10,6 @@ _hitpoint = _array select 2;
_type = typeOf _vehicle;
_isOK = false;
_brokenPart = false;
_started = false;
_finished = false;
_hasToolbox = "ItemToolbox" in items player;
_cancel = false;
@@ -27,28 +25,14 @@ if (_hasToolbox) then {
if ((_vehicle distance (_x select 0)) < (_x select 1)) exitWith {_cancel = true;};
} count DZE_SafeZonePosArray;
if (_cancel) exitWith { (localize "str_salvage_safezone") call dayz_rollingMessages;};
player playActionNow "Medic";
[player,"repair",0,false] call dayz_zombieSpeak;
[player,50,true,(getPosATL player)] call player_alertZombies;
// Added Nutrition-Factor for work
["Working",0,[20,40,15,0]] call dayz_NutritionSystem;
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then { _started = true; };
if (_started and !_isMedic) then { r_doLoop = false; _finished = true; };
if (r_interrupt) then { r_doLoop = false; };
uiSleep 0.1;
};
r_doLoop = false;
_finished = ["Medic",1] call fn_loopAction;
if (_finished) then {
["Working",0,[20,40,15,0]] call dayz_NutritionSystem;
//Remove melee magazines (BIS_fnc_invAdd fix)
false call dz_fn_meleeMagazines;
_damage = [_vehicle,_hitpoint] call object_getHit;
@@ -87,11 +71,6 @@ if (_hasToolbox) then {
};
true call dz_fn_meleeMagazines;
} else {
r_interrupt = false;
if (vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
localize "str_salvage_canceled" call dayz_rollingMessages;
};
} else {
@@ -100,7 +79,7 @@ if (_hasToolbox) then {
dayz_myCursorTarget = objNull;
s_player_repair_crtl = -1;
dayz_salvageInProgress = false;
dayz_actionInProgress = false;
//adding melee mags back if needed
_wpn = primaryWeapon player;

View File

@@ -1,4 +1,4 @@
private ["_vehicle","_curFuel","_newFuel","_started","_finished","_animState","_isMedic","_location1","_location2","_abort",
private ["_vehicle","_curFuel","_newFuel","_finished","_location1","_location2","_abort",
"_canNameEmpty","_canSizeEmpty","_canTypeEmpty","_canName","_canSize","_configCanEmpty","_configVeh","_capacity","_nameText",
"_availableCansEmpty","_hasHose","_PlayerNear"];
@@ -6,12 +6,12 @@ _vehicle = _this select 3;
player removeAction s_player_siphonfuel;
_hasHose = "equip_hose" in magazines player;
if (dayz_siphonFuelInProgress) exitWith { localize "str_siphon_inprogress" call dayz_rollingMessages; };
if (!_hasHose) exitWith {localize "str_siphon_hose" call dayz_rollingMessages; };
_PlayerNear = {isPlayer _x} count ((getPosATL _vehicle) nearEntities ["CAManBase", 10]) > 1;
if (_PlayerNear) exitWith {localize "str_pickup_limit_5" call dayz_rollingMessages;};
dayz_siphonFuelInProgress = true;
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
_abort = false;
// Static vehicle fuel information
@@ -52,39 +52,8 @@ _nameText = getText(_configVeh >> "displayName");
// alert zombies
[player,20,true,(getPosATL player)] call player_alertZombies;
if(!dayz_isSwimming) then {
// force animation
player playActionNow "Medic";
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
};
uiSleep 0.1;
};
r_doLoop = false;
if(!_finished) then {
r_interrupt = false;
if (vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
};
if (!dayz_isSwimming) then {
_finished = ["Medic",1] call fn_loopAction;
} else {
// Alternate method in water make sure player stays in one spot for 6 seconds
_location1 = getPosATL player;
@@ -151,4 +120,4 @@ _nameText = getText(_configVeh >> "displayName");
if(_abort) exitWith {};
} forEach magazines player;
dayz_siphonFuelInProgress = false;
dayz_actionInProgress = false;

View File

@@ -1,6 +1,6 @@
private ["_vehicle","_started","_finished","_animState","_isMedic","_soundObject"];
private ["_vehicle","_finished","_soundObject"];
if (dayz_actionInProgress) exitWith {localize "str_epoch_player_99" call dayz_rollingMessages;};
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
player removeAction s_player_fillgen;
@@ -9,56 +9,24 @@ s_player_fillgen = 1;
// Use target from addaction
_vehicle = _this select 3;
player playActionNow "Medic";
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
localize "str_epoch_player_100" call dayz_rollingMessages;
[player,50,true,(getPosATL player)] spawn player_alertZombies;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
};
uiSleep 0.1;
};
r_doLoop = false;
_finished = ["Medic",1] call fn_loopAction;
if(!_finished) then {
r_interrupt = false;
if (vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
if (!_finished) then {
localize "str_epoch_player_26" call dayz_rollingMessages;
};
} else {
// find sound and delete
_soundObject = _vehicle getVariable "GeneratorSound";
if (_finished) then {
deleteVehicle _soundObject;
// find sound && delete
_soundObject = _vehicle getVariable "GeneratorSound";
deleteVehicle _soundObject;
// Stop generator
_vehicle setVariable ["GeneratorRunning", false,true];
// Stop generator
_vehicle setVariable ["GeneratorRunning",false,true];
localize "str_epoch_player_101" call dayz_rollingMessages;
localize "str_epoch_player_101" call dayz_rollingMessages;
};
dayz_actionInProgress = false;

View File

@@ -1,104 +0,0 @@
private ["_item","_config","_text","_booleans","_worldspace","_dir","_location","_dis","_sfx","_tent","_classname","_object","_boundingBox","_maxPoint","_actionBuild","_actionCancel"];
/*
private ["_item", "_config", "_text", "_booleans", "_worldspace", "_dir", "_location", "_dis", "_sfx", "_tent"];
call gear_ui_init;
_item = _this;
_config = configFile >> "CfgMagazines" >> _item;
_text = getText (_config >> "displayName");
_classname = getText (_config >> "tentmodel");
//diag_log ("Classname: "+str(_classname));
//diag_log ("Item: "+str(_item));
if (dayz_actionInProgress) exitWith { localize "str_player_actionslimit" call dayz_rollingMessages; };
dayz_actionInProgress = true;
// item is missing or tools are missing
if ((!(_item IN magazines player))) exitWith {
dayz_actionInProgress = false;
format[localize "str_player_31",_text,localize "str_player_31_pitch"] call dayz_rollingMessages;
};
_booleans = []; //testonLadder, testSea, testPond, testBuilding, testSlope, testDistance
//remove tentbag
player removeMagazine _item;
//_dir = _worldspace select 0;
//_location = _worldspace select 1;
//wait a bit
//player playActionNow "Medic";
sleep 1;
// tent location may not be in front of player
//player setDir _dir;
//player setPosATL (getPosATL player);
_dis=20;
_sfx = "tentunpack";
//sleep 5;
localize "str_player_build_rotate" call dayz_rollingMessages;
_location = getMarkerpos "respawn_west";
_object = createVehicle [_classname, _location, [], 0, "NONE"];
// Attach item
_boundingBox = boundingBox _object;
_maxPoint = ((_boundingBox select 1) select 0) max ((_boundingBox select 1) select 1);
_object setPosATL [getPosATL _object select 0, getPosATL _object select 1, 0.01];
_object attachTo [player, [0, _maxPoint + 1, 0.3]];
//Vars
player setVariable ["constructionObject", _object];
_object setVariable ["characterID",dayz_characterID,true];
//Actions
_actionBuild = player addAction [localize "str_player_build_complete", "\z\addons\dayz_code\actions\object_build.sqf", [_object, _item, _classname, _text, true, _booleans, _dis, _sfx], 1, true];
_actionCancel = player addAction [localize "str_player_build_cancel", "\z\addons\dayz_code\actions\object_build.sqf", [_object, _item, _classname, _text, false, _booleans, _dis, _sfx], 1, true];
sleep 0.01;
while {!isNull (player getVariable "constructionObject")} do {
if (vehicle player != player) then {
player action ["eject", vehicle player];
};
if (speed player > 10 or speed player <= -8) then {
localize "str_player_build_movingfast" call dayz_rollingMessages;
player playMove "amovpercmstpssurwnondnon";
};
sleep 0.2;
if (!alive player) then {
[[],[],[],[_object, _item, _classname, _text, false, _booleans, _dis, _sfx]] call object_build;
};
};
player removeAction _actionBuild;
player removeAction _actionCancel;
*/
/*
sleep 5;
_tent = createVehicle ["TentStorage", getMarkerpos "respawn_west", [], 0, "CAN_COLLIDE"];
_tent setDir _dir;
_tent setPos _location; // follow terrain slope (works above sea level)
player reveal _tent;
_location = getPosATL _tent;
_tent setVariable ["characterID",dayz_characterID,true];
PVDZ_obj_Publish = [dayz_characterID,_tent,[_dir,_location],_classname];
publicVariableServer "PVDZ_obj_Publish";
localize "str_success_tent_pitch" call dayz_rollingMessages;
sleep 1;
} else {
localize "str_fail_tent_pitch" call dayz_rollingMessages;
};
dayz_actionInProgress = false;
*/

View File

@@ -1,4 +1,4 @@
private ["_vehicle","_started","_finished","_animState","_isMedic","_abort","_configVeh","_nameText","_findNearestVehicles","_findNearestVehicle","_IsNearVehicle","_towTruck","_towTruckSize","_allowedSize"];
private ["_vehicle","_finished","_configVeh","_nameText","_findNearestVehicles","_findNearestVehicle","_IsNearVehicle","_towTruck","_towTruckSize","_allowedSize"];
if (dayz_actionInProgress) exitWith {localize "str_epoch_player_96" call dayz_rollingMessages;};
dayz_actionInProgress = true;
@@ -37,45 +37,9 @@ if(_IsNearVehicle >= 1) then {
// alert zombies
[player,20,true,(getPosATL player)] spawn player_alertZombies;
_finished = false;
// force animation
player playActionNow "Medic";
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
};
uiSleep 0.1;
};
r_doLoop = false;
if(!_finished) then {
r_interrupt = false;
if (vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
_abort = true;
};
_finished = ["Medic",1] call fn_loopAction;
if (_finished) then {
if((sizeOf typeOf _vehicle) <= _allowedSize) then {
if([_vehicle,_towTruck] call fnc_isInsideBuilding && ((vectorUp _vehicle) select 2) > 0.5) then {
if(typeOf _towTruck == "TOW_DZE" ) then {
@@ -93,9 +57,6 @@ if(_IsNearVehicle >= 1) then {
};
};
} else {
localize "str_epoch_player_27" call dayz_rollingMessages;
};

View File

@@ -1,4 +1,4 @@
private ["_vehicle","_started","_finished","_animState","_isMedic","_configVeh","_nameText","_towTruck","_inTow"];
private ["_vehicle","_finished","_configVeh","_nameText","_towTruck","_inTow"];
if (dayz_actionInProgress) exitWith {localize "str_epoch_player_96" call dayz_rollingMessages;};
dayz_actionInProgress = true;
@@ -14,7 +14,7 @@ _inTow = _towTruck getVariable ["DZEinTow", false];
if(_inTow) then {
// select vehicl in tow
// select vehicle in tow
_vehicle = _towTruck getVariable ["DZEvehicleInTow", objNull];
if(!(isNull _towTruck)) then {
@@ -26,41 +26,7 @@ if(_inTow) then {
// alert zombies
[player,20,true,(getPosATL player)] spawn player_alertZombies;
_finished = false;
// force animation
player playActionNow "Medic";
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
};
uiSleep 0.1;
};
r_doLoop = false;
if(!_finished) then {
r_interrupt = false;
if (vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
};
_finished = ["Medic",1] call fn_loopAction;
if (_finished) then {