Add F_createManagedUnit function
This commit is contained in:
parent
be4a8adeac
commit
6a0db6c5eb
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
F_createManagedUnit
|
||||
|
||||
File: F_kp_createManagedUnit.sqf
|
||||
Author: veteran29 - https://github.com/veteran29
|
||||
Date: 2019-10-04
|
||||
Last Update: 2019-10-04
|
||||
|
||||
Description:
|
||||
Creates unit managed by kill tracker.
|
||||
|
||||
Parameter(s):
|
||||
0: STRING - Type of unit. (Default "")
|
||||
1: ARRAY|OBJECT|GROUP - Where to spawn. (Default [0,0,0])
|
||||
2: GROUP - Group to add the unit to. (Default objNull)
|
||||
3: STRING - Unit rank. (Default "PRIVATE")
|
||||
4: NUMBER - Placement radius. (Default 0)
|
||||
|
||||
Example:
|
||||
|
||||
|
||||
Returns:
|
||||
OBJECT - Created unit
|
||||
*/
|
||||
params [
|
||||
["_type", "", [""]]
|
||||
["_spawnPos", [0,0,0], [[], objNull, grpNull], [2,3]],
|
||||
["_group", grpNull, [grpNull]],
|
||||
["_rank", "PRIVATE", [""]],
|
||||
["_placement", 0, [0]]
|
||||
];
|
||||
|
||||
private _unit = _group createUnit [_type, _spawnPos, [], "FORM"];
|
||||
_unit addMPEventHandler ["MPKilled", {_this spawn kill_manager}];
|
||||
_unit setRank _rank;
|
||||
|
||||
_x createUnit [_start_pos, _troupgrp,"this ", _placement, "private"];
|
||||
|
||||
// Process KP object init
|
||||
[_unit] call F_addObjectInit;
|
||||
|
||||
_unit // return
|
|
@ -57,6 +57,7 @@ F_cr_ace_action = compileFinal preprocessFileLineNumbers "scripts\shared\functio
|
|||
F_getResistanceTier = compileFinal preprocessFileLineNumbers "scripts\shared\functions\F_kp_getResistanceTier.sqf";
|
||||
F_spawnGuerillaGroup = compileFinal preprocessFileLineNumbers "scripts\shared\functions\F_kp_spawnGuerillaGroup.sqf";
|
||||
F_createCrate = compileFinal preprocessFileLineNumbers "scripts\shared\functions\F_kp_createCrate.sqf";
|
||||
F_createManagedUnit = compileFinal preprocessFileLineNumbers "scripts\shared\functions\F_kp_createManagedUnit.sqf";
|
||||
F_isClassUAV = compileFinal preprocessFileLineNumbers "scripts\shared\functions\F_kp_isClassUAV.sqf";
|
||||
F_getWeaponComponents = compileFinal preprocessFileLineNumbers "scripts\shared\functions\F_kp_getWeaponComponents.sqf";
|
||||
F_removeWeaponCargo = compileFinal preprocessFileLineNumbers "scripts\shared\functions\F_kp_removeWeaponCargo.sqf";
|
||||
|
|
Loading…
Reference in New Issue