Skip to content

Commit 4eb576e

Browse files
committed
Added documentation and small refactors to fob_ammobox.sqf
1 parent c502453 commit 4eb576e

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

source/support/fob_ammobox.sqf

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,37 @@
1-
_target = _this select 0;
1+
/*
2+
File: fob_ammobox.sqf
3+
4+
Author: Kibot
5+
6+
Description:
7+
Variant of ammobox.sqf with less spread in deployment.
8+
Air-deploys a NATO ammobox with a parachute at a assigned location.
9+
10+
Parameter(s):
11+
_this select 0 - OBJECT - A non-nil object with a physical location.
212
13+
Usage:
14+
_scriptHandle = [player] execVM 'fob_ammobox.sqf';
15+
16+
Returns:
17+
- Nil -
18+
*/
19+
20+
_target = _this select 0;
321
_location = getpos _target;
422

5-
if (commandpointsblu1<2) exitWith
6-
{
7-
["info",["Not enough command points","Not enough Command Points (2CP required)"]] call bis_fnc_showNotification;
23+
if (commandpointsblu1<2) exitWith {
24+
["info",["Not enough command points","Not enough Command Points (2CP required)"]] call bis_fnc_showNotification;
825
};
926
commandpointsblu1 = commandpointsblu1 - 2;
1027
publicVariable "commandpointsblu1";
1128

1229
hint "A supply crate has been dropped near the FOB";
1330

31+
// Create the parachute
1432
_parachute = "Steerable_Parachute_F" CreateVehicle _location;
1533
_parachute setPos [_location select 0, _location select 1, (_location select 2)+50];
16-
34+
// Create the supply crate
1735
_ammo = "B_supplyCrate_F" CreateVehicle [_location select 0,_location select 1,(_location select 2)+20];
1836
_ammo attachTo [_parachute,[0,0,0]];
1937

@@ -33,10 +51,7 @@ _ammo addMagazineCargo ["Chemlight_green", 70];
3351
_ammo addBackpackCargo ["B_AssaultPack_khk",10];
3452

3553
if (support_armory_available) then {[[_ammo,["<t color='#ff1111'>Armory</t>","bisArsenal.sqf",[], 0, false, false, "", "_this distance _target < 4"]],"addAction",true,true] call BIS_fnc_MP;};
36-
37-
// magazines[] = {"1Rnd_HE_Grenade_shell","UGL_FlareWhite_F","UGL_FlareGreen_F","UGL_FlareRed_F","UGL_FlareYellow_F","UGL_FlareCIR_F","1Rnd_Smoke_Grenade_shell","1Rnd_SmokeRed_Grenade_shell","1Rnd_SmokeGreen_Grenade_shell","1Rnd_SmokeYellow_Grenade_shell","1Rnd_SmokePurple_Grenade_shell","1Rnd_SmokeBlue_Grenade_shell","1Rnd_SmokeOrange_Grenade_shell","3Rnd_HE_Grenade_shell","3Rnd_UGL_FlareWhite_F","3Rnd_UGL_FlareGreen_F","3Rnd_UGL_FlareRed_F","3Rnd_UGL_FlareYellow_F","3Rnd_UGL_FlareCIR_F","3Rnd_Smoke_Grenade_shell","3Rnd_SmokeRed_Grenade_shell","3Rnd_SmokeGreen_Grenade_shell","3Rnd_SmokeYellow_Grenade_shell","3Rnd_SmokePurple_Grenade_shell","3Rnd_SmokeBlue_Grenade_shell","3Rnd_SmokeOrange_Grenade_shell"};
3854

39-
4055
waitUntil {sleep 1; getpos _ammo select 2<0.2};
4156
_smoke = "SmokeShellGreen" CreateVehicle (getpos _ammo);
4257
["info",["Supply delivered","The supply crate has been marked with green smokes"]] call bis_fnc_showNotification;

0 commit comments

Comments
 (0)