-
-
Save commy2/93e91e4bae1b7b740b6b378c9bd55238 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// init.sqf | |
if (isServer) then { | |
0 spawn { | |
private _fnc_isDetectedUnitInArea = { | |
private _enemies = allUnits select {side group _x == east}; | |
allUnits inAreaArray "Marker1" select {side group _x == west} findIf { | |
private _target = _x; | |
_enemies findIf {_x knowsAbout _target >= 1.5} != -1 | |
} != -1 | |
}; | |
private _isDetected = false; | |
waitUntil { | |
sleep 1; | |
isNil { | |
if !(_isDetected isEqualTo call _fnc_isDetectedUnitInArea) then { | |
_isDetected = !_isDetected; | |
if (_isDetected) then { | |
"Enemies detected in area!" remoteExec ["systemChat"]; | |
} else { | |
"No enemies detected in area." remoteExec ["systemChat"]; | |
}; | |
}; | |
}; | |
false // indefinite loop | |
}; | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment