mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 12:12:34 +03:00
see the below links for more info. uiSleep is based off of a more accurate method of tracking time, whereas sleep can fluctuate depending on application performance since it is based on framerate. https://community.bistudio.com/wiki/uiSleep https://community.bistudio.com/wiki/sleep_vs_uiSleep https://community.bistudio.com/wiki/sleep
37 lines
883 B
Plaintext
37 lines
883 B
Plaintext
private ["_animalbody","_qty","_rawfoodtype"];
|
|
_animalbody = _this select 0;
|
|
|
|
if (local _animalbody) then {
|
|
_qty = _this select 1;
|
|
_rawfoodtype = getText (configFile >> "CfgSurvival" >> "Meat" >> typeOf _animalbody >> "rawfoodtype");
|
|
|
|
for "_x" from 1 to _qty do {
|
|
_animalbody addMagazine _rawfoodtype;
|
|
};
|
|
|
|
[time, _animalbody] spawn {
|
|
private ["_timer", "_body"];
|
|
_timer = _this select 0;
|
|
_body = _this select 1;
|
|
_pos = getPosATL _body;
|
|
while {(count magazines _body >0) && (time - _timer < 300) } do {
|
|
uiSleep 5;
|
|
};
|
|
|
|
hideBody _body;
|
|
|
|
/* PVS/PVC - Skaronator */
|
|
_inRange = _pos nearEntities ["CAManBase",100];
|
|
{
|
|
// only send to other players
|
|
if(isPlayer _x && _x != player) then {
|
|
PVDZE_send = [_x,"HideBody",[_body]];
|
|
publicVariableServer "PVDZE_send";
|
|
};
|
|
} count _inRange;
|
|
|
|
uiSleep 5;
|
|
deleteVehicle _body;
|
|
true;
|
|
};
|
|
}; |