-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Madin
authored and
Madin
committed
May 11, 2024
1 parent
fda3b98
commit 884cf3c
Showing
7 changed files
with
78 additions
and
14 deletions.
There are no files selected for viewing
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
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
35 changes: 35 additions & 0 deletions
35
addons/staticspawn/functions/fnc_checkRespawnConditionLoop.sqf
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include "script_component.hpp" | ||
/* | ||
* Author: <author> | ||
* Function description | ||
* | ||
* Arguments: | ||
* 0: Objects <ARRAY> | ||
* 1: All <BOOL> | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Example: | ||
* [[bob, ted], false] call afmf_main_fnc_example | ||
* | ||
* Public: No | ||
*/ | ||
|
||
params [["_logic", objNull], ["_unitArray", []], ["_groupID", objNull], ["_group", grpNull], ["_groups", []], ["_side", []], ["_pos", [0,0,0]], ["_waitUntil", 0]]; | ||
|
||
private _sphereBackDistance = _logic getVariable [QGVAR(sphereBackDistance), 30]; | ||
private _nearplayers = _pos nearEntities ["allVehicles", _sphereBackDistance]; | ||
private _playerIndex = _nearplayers findIf {isPlayer _x}; | ||
// stop spawn near units if player nearby | ||
if (_playerIndex > -1) exitWith {}; | ||
|
||
if (_waitUntil <= time) exitWith { | ||
[_logic, _unitArray, _groupID, _group, _groups, _side] call FUNC(despawnAddToLogic); | ||
}; | ||
|
||
[ | ||
{_this call FUNC(checkRespawnConditionLoop)}, | ||
_this, | ||
0.9 + random 0.2 | ||
] call CBA_fnc_waitAndExecute; |
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
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
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
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