From 27e464d47e48ead8833f952313020e0cc060f82d Mon Sep 17 00:00:00 2001 From: AirwavesMan Date: Sat, 12 Sep 2020 15:18:30 +0200 Subject: [PATCH] More fnc_alertZombies updates --- SQF/dayz_code/actions/fill_nearestVehicle.sqf | 13 ++++++------- SQF/dayz_code/actions/player_attach_bomb.sqf | 15 +++++++-------- SQF/dayz_code/actions/player_destroyTent.sqf | 7 ++----- SQF/dayz_code/actions/siphonFuel.sqf | 3 --- SQF/dayz_code/actions/water_fill.sqf | 3 +-- SQF/dayz_code/compile/player_unlockVault.sqf | 3 +-- 6 files changed, 17 insertions(+), 27 deletions(-) diff --git a/SQF/dayz_code/actions/fill_nearestVehicle.sqf b/SQF/dayz_code/actions/fill_nearestVehicle.sqf index ab383bc62..95c169eee 100644 --- a/SQF/dayz_code/actions/fill_nearestVehicle.sqf +++ b/SQF/dayz_code/actions/fill_nearestVehicle.sqf @@ -1,7 +1,8 @@ -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; +private ["_isFuelTruck","_fuelTruckCapacity","_finished","_newFuel","_abort","_newFuelSrc","_canSize","_vehicle","_configVeh","_capacity","_nameText","_fuelTruck","_findNearestVehicle"]; + _fuelTruck = _this select 3; _abort = false; @@ -33,9 +34,9 @@ if (count _findNearestVehicle >= 1) then { while {true} do { // qty to add per loop _canSize = (_capacity / 10); - + format[localize "str_epoch_player_131",_nameText] call dayz_rollingMessages; - [player,20,true,(getPosATL player)] spawn player_alertZombies; + [player,(getPosATL player),20,"refuel"] spawn fnc_alertZombies; _finished = ["Medic",1] call fn_loopAction; if (!_finished) then { @@ -58,7 +59,6 @@ if (count _findNearestVehicle >= 1) then { PVDZ_send = [_vehicle,"SetFuel",[_vehicle,_newFuel]]; publicVariableServer "PVDZ_send"; }; - [player,"refuel",0,false] call dayz_zombieSpeak; format[localize "str_epoch_player_132",_nameText,round(_newFuel*100)] call dayz_rollingMessages; } else { _abort = true; @@ -66,14 +66,13 @@ if (count _findNearestVehicle >= 1) then { } else { //Filling near vehicle at gas station with generator if (_newFuel >= _capacity) then {_newFuel = 1; _abort = true;} else {_newFuel = (_newFuel / _capacity);}; - + if (local _vehicle) then { [_vehicle,_newFuel] call local_setFuel; } else { PVDZ_send = [_vehicle,"SetFuel",[_vehicle,_newFuel]]; publicVariableServer "PVDZ_send"; }; - [player,"refuel",0,false] call dayz_zombieSpeak; format[localize "str_epoch_player_132",_nameText,round(_newFuel*100)] call dayz_rollingMessages; }; }; @@ -81,7 +80,7 @@ if (count _findNearestVehicle >= 1) then { if (_abort) exitWith { ["Working",0,[0,1,3,0]] call dayz_NutritionSystem; }; - uiSleep 1; + uiSleep 1; }; } else { localize "str_epoch_player_27" call dayz_rollingMessages; diff --git a/SQF/dayz_code/actions/player_attach_bomb.sqf b/SQF/dayz_code/actions/player_attach_bomb.sqf index e095c4039..decc795cf 100644 --- a/SQF/dayz_code/actions/player_attach_bomb.sqf +++ b/SQF/dayz_code/actions/player_attach_bomb.sqf @@ -1,3 +1,6 @@ +if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;}; +dayz_actionInProgress = true; + private ["_theBomb","_vehicle","_curFuel","_newFuel","_timeLeft","_hasToolbox","_hasCarBomb","_dis","_sfx","_alreadyBombed","_hasCrowbar","_finished"]; _vehicle = _this select 3; @@ -5,27 +8,23 @@ _hasToolbox = "ItemToolbox" in items player; _hasCrowbar = "ItemCrowbar" in items player; _hasCarBomb = "ItemCarBomb" in magazines player; _alreadyBombed = _vehicle getVariable["hasBomb",false]; + if(!_hasToolbox or !_hasCrowbar) exitWith { + dayz_actionInProgress = false; localize "str_bombToolMissing" call dayz_rollingMessages; }; if(!_hasCarBomb) exitWith { + dayz_actionInProgress = false; 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; }; */ -//DO Animation -_dis=20; -_sfx = "tentunpack"; -[player,_sfx,0,false,_dis] call dayz_zombieSpeak; -[player,_dis,true,(getPosATL player)] spawn player_alertZombies; +[player,(getPosATL player),20,"tentunpack"] spawn fnc_alertZombies; _finished = ["Medic",1] call fn_loopAction; if (!_finished or !("ItemCarBomb" in magazines player)) exitWith { diff --git a/SQF/dayz_code/actions/player_destroyTent.sqf b/SQF/dayz_code/actions/player_destroyTent.sqf index 4089c5d40..506bb07d8 100644 --- a/SQF/dayz_code/actions/player_destroyTent.sqf +++ b/SQF/dayz_code/actions/player_destroyTent.sqf @@ -1,7 +1,7 @@ if (dayz_actionInProgress) exitWith { localize "str_player_actionslimit" call dayz_rollingMessages; }; dayz_actionInProgress = true; -private ["_emptycan","_objectID","_objectUID","_obj","_fuelArray","_matchArray","_randomJerryCan","_fireIntensity","_dis","_sfx","_finished"]; +private ["_emptycan","_objectID","_objectUID","_obj","_fuelArray","_matchArray","_randomJerryCan","_fireIntensity","_finished"]; //Tent Object _obj = _this select 3; @@ -34,10 +34,7 @@ if ((count _matchArray == 0)) exitwith { dayz_actionInProgress = false; systemCh player removeAction s_player_destroytent; s_player_destroytent = -1; -_dis=20; -_sfx = "tentpack"; -[player,_sfx,0,false,_dis] call dayz_zombieSpeak; -[player,_dis,true,(getPosATL player)] call player_alertZombies; +[player,(getPosATL player),20,"tentpack"] spawn fnc_alertZombies; _finished = ["Medic",1] call fn_loopAction; if (!_finished or (isNull _obj)) exitWith { diff --git a/SQF/dayz_code/actions/siphonFuel.sqf b/SQF/dayz_code/actions/siphonFuel.sqf index 4e6e8e178..e5a740245 100644 --- a/SQF/dayz_code/actions/siphonFuel.sqf +++ b/SQF/dayz_code/actions/siphonFuel.sqf @@ -79,9 +79,6 @@ _nameText = getText(_configVeh >> "displayName"); publicVariableServer "PVDZ_send"; }; - // Play sound - [player,"refuel",0,false] call dayz_zombieSpeak; - player addMagazine _canName; ["Working",0,[20,40,15,0]] call dayz_NutritionSystem; diff --git a/SQF/dayz_code/actions/water_fill.sqf b/SQF/dayz_code/actions/water_fill.sqf index 6e41bbd30..ae538bdd5 100644 --- a/SQF/dayz_code/actions/water_fill.sqf +++ b/SQF/dayz_code/actions/water_fill.sqf @@ -79,8 +79,7 @@ if (_drinking) then { foreach magazines player; if (_filled > 0) then { - [player, "fillwater", 0, false, 5] call dayz_zombieSpeak; - [player, 5, true, _posATL] call player_alertZombies; + [player,(getPosATL player),5,"fillwater"] spawn fnc_alertZombies; format [localize "str_player_01", _filled] call dayz_rollingMessages; } else { localize "str_player_02" call dayz_rollingMessages; diff --git a/SQF/dayz_code/compile/player_unlockVault.sqf b/SQF/dayz_code/compile/player_unlockVault.sqf index e4adef760..470aa28ff 100644 --- a/SQF/dayz_code/compile/player_unlockVault.sqf +++ b/SQF/dayz_code/compile/player_unlockVault.sqf @@ -55,8 +55,7 @@ if (_ComboMatch || (_ownerID == dayz_playerUID)) then { PVDZE_handleSafeGear = [player,_obj,3,dayz_combination,dayz_authKey]; publicVariableServer "PVDZE_handleSafeGear"; - [player,"repair",0,false] call dayz_zombieSpeak; - [player,25,true,(getPosATL player)] spawn player_alertZombies; + [player,(getPosATL player),40,"repair"] spawn fnc_alertZombies; if (DZE_lockablesHarderPenalty) then { dayz_lastCodeFail = (diag_tickTime + dayz_UnlockTime);