-
Notifications
You must be signed in to change notification settings - Fork 1
/
Reinforcements.sqf
77 lines (61 loc) · 1.81 KB
/
Reinforcements.sqf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
Loiter = {
_veh = _this select 0;
_player = _this select 1;
_vehicleReady = _this select 2;
_loiterDistance = _this select 3;
_group = group ((crew _veh) select 0);
_loitering = true;
_pos = _player getPos [_loiterDistance * sqrt random 1, random 360];
_group move _pos;
waituntil {[_veh] call _vehicleReady};
[_veh, _loitering, _player, _vehicleReady, _group, _loiterDistance] spawn {
_veh = _this select 0;
_loitering = _this select 1;
_player = _this select 2;
_vehicleReady = _this select 3;
_group = _this select 4;
_loiterDistance = _this select 5;
while { alive _veh && _loitering } do {
_pos = _player getPos [_loiterDistance * sqrt random 1, random 360];
_group move _pos;
waituntil {[_veh] call _vehicleReady};
};
};
sleep 60;
_veh doMove (_player getPos [1000, random 360]);
sleep 30;
{ deleteVehicle _x; } forEach (crew _veh);
deleteVehicle _veh;
};
CallReinforcement = {
_player = _this select 0;
_playerSide = side player;
_random = _this select 1;
private ["_vehicle"];
_vehicles = [
["B_Heli_Transport_01_camo_F", 2000, 50],
["B_T_LSV_01_armed_F", 200, 20]
];
if (_random < .8) then {
_vehicle = _vehicles select 0;
};
if (_random < 1) then {
_vehicle = _vehicles select 1;
};
_vehicleClass = _vehicle select 0;
_distance = _vehicle select 1;
_loiterDistance = _vehicle select 2;
_position = _player getPos [_distance * sqrt random 1, random 360];
_veh = createVehicle [_vehicleClass, _position, [], random 360, "FLY"];
createVehicleCrew _veh;
_group = createGroup _playerSide;
{
[_x] joinSilent grpNull;
[_x] joinSilent _group;
_x setSkill 1;
_x setBehaviour "COMBAT";
_x setCombatMode "YELLOW";
_x assignTeam (assignedTeam _player);
} forEach (crew _veh);
[_veh, _player, VehicleReady, _loiterDistance] spawn Loiter;
};