mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-18 17:42:01 +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
34 lines
924 B
Plaintext
34 lines
924 B
Plaintext
private ["_array", "_handle", "_watchDog", "_dog", "_warn"];
|
|
_array = _this select 3;
|
|
_handle = _array select 0;
|
|
_watchDog = _array select 1;
|
|
_dog = _handle getFSMVariable "_dog";
|
|
|
|
player removeAction s_player_warndog;
|
|
s_player_warndog = -1;
|
|
|
|
_handle setFSMVariable ["_watchDog",_watchDog];
|
|
|
|
_warn = {
|
|
private ["_watchDog","_dog","_nearby","_senseSkill","_handle"];
|
|
_handle = _this select 0;
|
|
while {_watchDog && alive _dog} do {
|
|
_watchDog = _handle getFSMVariable "_watchDog";
|
|
_senseSkill = _handle getFSMVariable "_senseSkill";
|
|
if (_watchDog) then {
|
|
_nearby = (getPosATL _dog) nearEntities ["CAManBase",_senseSkill];
|
|
_nearby = _nearby - [player];
|
|
if (count _nearby > 0) then {
|
|
[_dog,"dog_growl",2,false] call dayz_zombieSpeak;
|
|
};
|
|
};
|
|
uiSleep 2;
|
|
};
|
|
};
|
|
|
|
if (_watchDog) then {
|
|
_handle setFSMVariable ["_idleTime",5];
|
|
[_handle] spawn _warn;
|
|
} else {
|
|
_handle setFSMVariable ["_idleTime",1];
|
|
}; |