Hide body changes

Remove the PVCDZ_obj_HideBody eventhandler. Players next to a hided animal see the hiding process too and after 10s the body will be deleted anyways. So there is no need to send a publicVariableServer first then back to all near clients if the body gets deleted within 10s.
Also updates the normal hide body. The hided player model gets deleted by the server now.
This commit is contained in:
AirwavesMan
2020-11-19 15:10:10 +01:00
parent 72650aa7ca
commit 86d52c907d
5 changed files with 11 additions and 33 deletions

View File

@@ -55,8 +55,6 @@ if ((count _knifeArray > 0) and !_hasHarvested) then {
} else {
PVCDZ_obj_GutBody =[_item,_qty];
publicVariable "PVCDZ_obj_GutBody";
//if (!achievement_Gut) then {achievement_Gut = true;};
};
["knives",0.2] call fn_dynamicTool;

View File

@@ -1,21 +1,23 @@
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private "_body";
player removeAction s_player_hide_body;
s_player_hide_body = -1;
closeDialog 0;
_body = _this select 3;
if (isNull _body) exitWith { dayz_actionInProgress = false;};
local _body = _this select 3;
if (isNull _body) exitWith {systemChat localize "str_cursorTargetNotFound"; dayz_actionInProgress = false;};
player action ["hideBody", _body];
dayz_actionInProgress = false;
if (_body isKindOf "zZombie_base" || {_body isKindOf "Animal"}) then {
uisleep 5;
uisleep 10;
if ((_body getVariable ["bodyName","unknown"]) != "unknown") then {
PVDZ_plr_Delete = _body;
publicVariableServer "PVDZ_plr_Delete";
} else {
deleteVehicle _body;
};
};

View File

@@ -307,11 +307,7 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis
player removeAction s_player_fillfuel5;
s_player_fillfuel5 = -1;
};
/*
Vanilla generator is currently not functional.
Vanilla generator refuel actions removed for now.
Epoch generator fill action is below.
*/
//Allow player to siphon vehicles
if (_hasEmptyFuelCan && !_isBicycle && {fuel _cursorTarget > 0}) then {
if (s_player_siphonfuel < 0) then {

View File

@@ -31,20 +31,7 @@ if (local _animalbody) then {
};
hideBody _body;
//No need to let everyone on the server know.
//PVCDZ_obj_HideBody = _body;
//publicVariable "PVCDZ_obj_HideBody"; // remote player
//Send to server let everyone in 100 meters of the body know its just been hidden.
_inRange = _pos nearEntities ["CAManBase",100];
{
if ((isPlayer _x) && {_x != player}) then {
PVDZ_send = [_x,"HideBody",[_body]];
publicVariableServer "PVDZ_send";
};
} count _inRange;
uiSleep 5;
uiSleep 10;
deleteVehicle _body;
true
};

View File

@@ -61,11 +61,6 @@ call {
_owner publicVariableClient "PVCDZ_obj_GutBody";
};
if (_variable == "HideBody") exitWith {
PVCDZ_obj_HideBody = _arraytosend select 0;
_owner publicVariableClient "PVCDZ_obj_HideBody";
};
if (_variable == "Humanity") exitWith {
PVCDZ_plr_Humanity = _arraytosend select 0;
_owner publicVariableClient "PVCDZ_plr_Humanity";