Skip to content

Commit 5ab3428

Browse files
committed
Added documentation and small refactors to ammobox.sqf
1 parent c0e42f6 commit 5ab3428

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

source/support/ammobox.sqf

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

321
_location = getpos _target;
422

5-
if (commandpointsblu1<2) exitWith
6-
{
23+
if (commandpointsblu1<2) exitWith {
724
["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 your location";
1330

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

@@ -34,10 +52,6 @@ _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;};
3654

37-
38-
// 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"};
39-
40-
4155
waitUntil {sleep 1; getpos _ammo select 2<0.2};
4256
_smoke = "SmokeShellGreen" CreateVehicle (getpos _ammo);
4357
["info",["Supply delivered","The supply crate has been marked with green smokes"]] call bis_fnc_showNotification;

0 commit comments

Comments
 (0)