BIS_fnc_spawnEnemy
- Runs with spawn
- Arma 3 v0.50
- First in Arma 2: Operation Arrowhead v1.50
Function · Markdown · JSON · original wiki page
Description
Constantly spawns enemies around a player according to array of enemy classes. The units will try to hunt down the player.
Syntax
[aPlayer, target, side, classes, maxEnemies, delay, code] spawn BIS_fnc_spawnEnemy
Parameters:
-
aPlayer: Object - a unit that is a player -
target: Object - reference object (enemies will be spawned on same direction in respect to the player) -
side: Side - side of the spawned enemies -
classes: Array of Strings - list of enemy classes (units will form a group together)Important
Classes must be of the defined side, otherwise they will attack each other.
-
maxEnemies: Number - (Optional, default 10) maximum number of enemies at once -
delay: Number - (Optional, default 30) time between spawn waves -
code: Code - (Optional, default {}) - code to execute on each unit (referenced by _this)
Returns: Nothing
Examples
Example 1
[player, player, opfor, ["O_Soldier_F"]] spawn BIS_fnc_spawnEnemy;