2015-12-07 16:24:52 +00:00
|
|
|
/*
|
|
|
|
Author: Andrew Gregory - EpochMod.com
|
|
|
|
|
|
|
|
Contributors:
|
|
|
|
|
|
|
|
Description:
|
|
|
|
test code to spawn trader milita (unused)
|
|
|
|
|
|
|
|
Licence:
|
|
|
|
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
|
|
|
|
|
|
|
|
Github:
|
2016-06-13 16:54:19 +00:00
|
|
|
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/EPOCH_SpawnTraderMiltia.sqf
|
2015-12-07 16:24:52 +00:00
|
|
|
*/
|
2016-09-01 00:29:08 +00:00
|
|
|
//[[[cog import generate_private_arrays ]]]
|
2017-09-02 22:06:27 +00:00
|
|
|
private ["_allpositions","_grp","_nrBuilds","_rndHouse","_startPos","_unit"];
|
2016-09-01 00:29:08 +00:00
|
|
|
//[[[end]]]
|
2017-09-02 22:06:27 +00:00
|
|
|
|
|
|
|
_nrBuilds = nearestObjects [player,["house"],50];
|
2015-09-14 20:55:36 +00:00
|
|
|
|
2017-03-26 15:21:26 +00:00
|
|
|
_grp = createGroup [RESISTANCE, true];
|
2015-09-14 20:55:36 +00:00
|
|
|
for "_i" from 1 to 3 step 1 do
|
|
|
|
{
|
|
|
|
_startPos = [];
|
|
|
|
while {count _startPos < 1} do {
|
2016-04-08 20:21:46 +00:00
|
|
|
_rndHouse = selectRandom _nrBuilds;
|
|
|
|
_allpositions = _rndHouse buildingPos -1;
|
|
|
|
if !(_allpositions isEqualTo []) then {
|
|
|
|
_startPos = selectRandom _allpositions;
|
2015-09-14 20:55:36 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
_unit = _grp createUnit["B_G_Soldier_F", _startPos, [], 0, "CAN_COLLIDE"];
|
2015-12-07 16:24:52 +00:00
|
|
|
_unit addEventHandler ["FiredNear", "group (_this select 0) setVariable[""shotsFired"",[(_this select 1),(_this select 2)]]"];
|
2015-09-14 20:55:36 +00:00
|
|
|
_unit addEventHandler ["Killed", "group (_this select 0) setVariable[""killer"",_this select 1]"];
|
|
|
|
[_unit] execFSM "\x\addons\a3_epoch_code\System\Trader_Militia.fsm";
|
|
|
|
};
|