mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
Should improve client FPS while still allowing conditions and scripts to be customized. Some special vehicles like MV22, UH1Y, etc. have UserActions overwritten in their configs, so please let me know if you find any others that do not get the option to repair or salvage because UserActions is overwritten in their config. I think I got them all. Vanilla commits:a8c4238c0c350d73abe1
52 lines
1.3 KiB
Plaintext
52 lines
1.3 KiB
Plaintext
private ["_amount","_animalbody","_rawfoodtype","_qty"];
|
|
|
|
_animalbody = _this select 0;
|
|
_qty = _this select 1;
|
|
|
|
if (_animalbody isKindOf "zZombie_base") then {
|
|
_qty = 1;
|
|
_rawfoodtype = "ItemZombieParts";
|
|
} else {
|
|
_rawfoodtype = getText (configFile >> "CfgSurvival" >> "Meat" >> typeOf _animalbody >> "rawfoodtype");
|
|
};
|
|
|
|
if (local _animalbody) then {
|
|
for "_i" from 1 to _qty do {
|
|
_animalbody addMagazine _rawfoodtype;
|
|
};
|
|
|
|
if (typeOf _animalbody in ["Cock","Hen"]) then {
|
|
_amount = (floor (random 4)) + 2;
|
|
for "_x" from 1 to _amount do {
|
|
_animalbody addMagazine "equip_feathers";
|
|
};
|
|
};
|
|
|
|
[time, _animalbody] spawn {
|
|
_timer = _this select 0;
|
|
_body = _this select 1;
|
|
_pos = getPosATL _body;
|
|
while {(count magazines _body > 0) && (time - _timer < 300)} do {
|
|
uiSleep 5;
|
|
};
|
|
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;
|
|
deleteVehicle _body;
|
|
true
|
|
};
|
|
};
|