Skip to content

Commit 93b17e0

Browse files
committed
Reorganized switch statements to match up with array.
Corrected error where switch cases no longer aligned with menu items Refactored switch statements to be in numerical order Commented in the vehicle name to make it easier to identify the vehicle in the statement
1 parent 9e796af commit 93b17e0

File tree

1 file changed

+58
-78
lines changed

1 file changed

+58
-78
lines changed

source/dialog/request_vehicle.sqf

Lines changed: 58 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ _spawnPos = getpos player;
55
_spawnPos = [(_spawnPos select 0)+30, _spawnPos select 1];
66

77
switch (_index) do {
8-
case 0: {
8+
case 0: { // Small Truck 1
99
if (commandpointsblu1 >= 4) then {
1010
hint "Vehicle ready !";
1111
commandpointsblu1 = commandpointsblu1 - 4;
@@ -15,7 +15,7 @@ switch (_index) do {
1515
hint "Not enough command points";
1616
};
1717
};
18-
case 1: {
18+
case 1: { // Small Truck 2
1919
if (commandpointsblu1 >= 6) then {
2020
hint "Vehicle ready !";
2121
commandpointsblu1 = commandpointsblu1 - 6;
@@ -25,7 +25,27 @@ switch (_index) do {
2525
hint "Not enough command points";
2626
};
2727
};
28-
case 2: {
28+
case 2: { // Prowler Unarmed
29+
if (commandpointsblu1 >= 5) then {
30+
hint "Vehicle ready !";
31+
commandpointsblu1 = commandpointsblu1 - 100;
32+
ctrlSetText [1000, format["%1",commandpointsblu1]];
33+
_vehic = "B_T_LSV_01_unarmed_F" createVehicle _spawnPos;
34+
} else {
35+
hint "Not enough command points";
36+
};
37+
};
38+
case 3: { // Prowler Armed
39+
if (commandpointsblu1 >= 100) then {
40+
hint "Vehicle ready !";
41+
commandpointsblu1 = commandpointsblu1 - 100;
42+
ctrlSetText [1000, format["%1",commandpointsblu1]];
43+
_vehic = "B_T_LSV_01_armed_F" createVehicle _spawnPos;
44+
} else {
45+
hint "Not enough command points";
46+
};
47+
};
48+
case 4: { // Hunter Unarmed
2949
if (commandpointsblu1 >= 5) then {
3050
hint "Vehicle ready !";
3151
commandpointsblu1 = commandpointsblu1 - 5;
@@ -35,7 +55,7 @@ switch (_index) do {
3555
hint "Not enough command points";
3656
};
3757
};
38-
case 3: {
58+
case 5: { // Hunter HMG
3959
if (commandpointsblu1 >= 18) then {
4060
hint "Vehicle ready !";
4161
commandpointsblu1 = commandpointsblu1 - 18;
@@ -45,7 +65,7 @@ switch (_index) do {
4565
hint "Not enough command points";
4666
};
4767
};
48-
case 4: {
68+
case 6: { // Hunter GMG
4969
if (commandpointsblu1 >= 25) then {
5070
hint "Vehicle ready !";
5171
commandpointsblu1 = commandpointsblu1 - 25;
@@ -55,7 +75,7 @@ switch (_index) do {
5575
hint "Not enough command points";
5676
};
5777
};
58-
case 5: {
78+
case 7: { // Marshall
5979
if (commandpointsblu1 >= 35) then {
6080
hint "Vehicle ready !";
6181
commandpointsblu1 = commandpointsblu1 - 35;
@@ -65,7 +85,7 @@ switch (_index) do {
6585
hint "Not enough command points";
6686
};
6787
};
68-
case 6: {
88+
case 8: { //HEMETT Transport Covered
6989
if (commandpointsblu1 >= 8) then {
7090
hint "Vehicle ready !";
7191
commandpointsblu1 = commandpointsblu1 - 8;
@@ -75,7 +95,7 @@ switch (_index) do {
7595
hint "Not enough command points";
7696
};
7797
};
78-
case 7: {
98+
case 9: { // Pawnee
7999
if (commandpointsblu1 >= 25) then {
80100
hint "Vehicle ready !";
81101
commandpointsblu1 = commandpointsblu1 - 25;
@@ -85,7 +105,7 @@ switch (_index) do {
85105
hint "Not enough command points";
86106
};
87107
};
88-
case 8: {
108+
case 10: { // Blackfoot
89109
if (commandpointsblu1 >= 45) then {
90110
hint "Vehicle ready !";
91111
commandpointsblu1 = commandpointsblu1 - 45;
@@ -95,7 +115,7 @@ switch (_index) do {
95115
hint "Not enough command points";
96116
};
97117
};
98-
case 9: {
118+
case 11: { // HummingBird
99119
if (commandpointsblu1 >= 15) then {
100120
hint "Vehicle ready !";
101121
commandpointsblu1 = commandpointsblu1 - 15;
@@ -105,7 +125,7 @@ switch (_index) do {
105125
hint "Not enough command points";
106126
};
107127
};
108-
case 10: {
128+
case 12: { // M-900 Civ.
109129
if (commandpointsblu1 >= 12) then {
110130
hint "Vehicle ready !";
111131
commandpointsblu1 = commandpointsblu1 - 12;
@@ -116,7 +136,7 @@ switch (_index) do {
116136
hint "Not enough command points";
117137
};
118138
};
119-
case 11: {
139+
case 13: { // Taru Empty
120140
if (commandpointsblu1 >= 18) then {
121141
hint "Vehicle ready !";
122142
commandpointsblu1 = commandpointsblu1 - 18;
@@ -127,7 +147,7 @@ switch (_index) do {
127147
hint "Not enough command points";
128148
};
129149
};
130-
case 12: {
150+
case 14: { // GhostHawk
131151
if (commandpointsblu1 >= 22) then {
132152
hint "Vehicle ready !";
133153
commandpointsblu1 = commandpointsblu1 - 22;
@@ -137,7 +157,7 @@ switch (_index) do {
137157
hint "Not enough command points";
138158
};
139159
};
140-
case 13: {
160+
case 15: { // Huron
141161
if (commandpointsblu1 >= 26) then {
142162
hint "Vehicle ready !";
143163
commandpointsblu1 = commandpointsblu1 - 26;
@@ -147,7 +167,7 @@ switch (_index) do {
147167
hint "Not enough command points";
148168
};
149169
};
150-
case 14: {
170+
case 16: { // Panther IFV
151171
if (commandpointsblu1 >= 25) then {
152172
hint "Vehicle ready !";
153173
commandpointsblu1 = commandpointsblu1 - 25;
@@ -157,7 +177,7 @@ switch (_index) do {
157177
hint "Not enough command points";
158178
};
159179
};
160-
case 15: {
180+
case 17: { // ATV Quad
161181
if (commandpointsblu1 >= 1) then {
162182
hint "Vehicle ready !";
163183
commandpointsblu1 = commandpointsblu1 - 1;
@@ -167,7 +187,7 @@ switch (_index) do {
167187
hint "Not enough command points";
168188
};
169189
};
170-
case 16: {
190+
case 18: { // Cheetah AA
171191
if (commandpointsblu1 >= 30) then {
172192
hint "Vehicle ready !";
173193
commandpointsblu1 = commandpointsblu1 - 30;
@@ -177,7 +197,7 @@ switch (_index) do {
177197
hint "Not enough command points";
178198
};
179199
};
180-
case 17: {
200+
case 19: { // Slammer
181201
if (commandpointsblu1 >= 40) then {
182202
hint "Vehicle ready !";
183203
commandpointsblu1 = commandpointsblu1 - 40;
@@ -187,7 +207,7 @@ switch (_index) do {
187207
hint "Not enough command points";
188208
};
189209
};
190-
case 18: {
210+
case 20: { // Bobcat
191211
if (commandpointsblu1 >= 28) then {
192212
hint "Vehicle ready !";
193213
commandpointsblu1 = commandpointsblu1 - 28;
@@ -197,7 +217,7 @@ switch (_index) do {
197217
hint "Not enough command points";
198218
};
199219
};
200-
case 19: {
220+
case 21: { // SF SUV
201221
if (commandpointsblu1 >= 2) then {
202222
hint "Vehicle ready !";
203223
commandpointsblu1 = commandpointsblu1 - 2;
@@ -219,7 +239,7 @@ switch (_index) do {
219239
hint "Not enough command points";
220240
};
221241
};
222-
case 20: {
242+
case 22: { // MLRS Artillery
223243
if (commandpointsblu1 >= 75) then {
224244
hint "Vehicle ready !";
225245
commandpointsblu1 = commandpointsblu1 - 75;
@@ -229,7 +249,7 @@ switch (_index) do {
229249
hint "Not enough command points";
230250
};
231251
};
232-
case 21: {
252+
case 23: { // Scorcher Artillery
233253
if (commandpointsblu1 >= 75) then {
234254
hint "Vehicle ready !";
235255
commandpointsblu1 = commandpointsblu1 - 75;
@@ -239,7 +259,7 @@ switch (_index) do {
239259
hint "Not enough command points";
240260
};
241261
};
242-
case 22: {
262+
case 24: { // Fuel Truck (van)
243263
if (commandpointsblu1 >= 10) then {
244264
hint "Vehicle ready !";
245265
commandpointsblu1 = commandpointsblu1 - 10;
@@ -249,7 +269,7 @@ switch (_index) do {
249269
hint "Not enough command points";
250270
};
251271
};
252-
case 23: {
272+
case 25: { // Wipeout CAS
253273
if (commandpointsblu1 >= 45) then {
254274
hint "Vehicle ready !";
255275
commandpointsblu1 = commandpointsblu1 - 45;
@@ -259,7 +279,7 @@ switch (_index) do {
259279
hint "Not enough command points";
260280
};
261281
};
262-
case 24: {
282+
case 26: { // Slammer Urban Purpose
263283
if (commandpointsblu1 >= 40) then {
264284
hint "Vehicle ready !";
265285
commandpointsblu1 = commandpointsblu1 - 40;
@@ -269,7 +289,7 @@ switch (_index) do {
269289
hint "Not enough command points";
270290
};
271291
};
272-
case 25: {
292+
case 27: { // Stomper RCWS
273293
if (commandpointsblu1 >= 20) then {
274294
hint "Vehicle ready !";
275295
commandpointsblu1 = commandpointsblu1 - 20;
@@ -279,7 +299,7 @@ switch (_index) do {
279299
hint "Not enough command points";
280300
};
281301
};
282-
case 26: {
302+
case 28: { // Stomper Scout
283303
if (commandpointsblu1 >= 10) then {
284304
hint "Vehicle ready !";
285305
commandpointsblu1 = commandpointsblu1 - 10;
@@ -289,7 +309,7 @@ switch (_index) do {
289309
hint "Not enough command points";
290310
};
291311
};
292-
case 27: {
312+
case 29: { // Greyhawk ATG
293313
if (commandpointsblu1 >= 15) then {
294314
hint "Vehicle ready !";
295315
commandpointsblu1 = commandpointsblu1 - 15;
@@ -299,7 +319,7 @@ switch (_index) do {
299319
hint "Not enough command points";
300320
};
301321
};
302-
case 28: {
322+
case 30: { // Greyhawk CAS
303323
if (commandpointsblu1 >= 15) then {
304324
hint "Vehicle ready !";
305325
commandpointsblu1 = commandpointsblu1 - 15;
@@ -309,57 +329,27 @@ switch (_index) do {
309329
hint "Not enough command points";
310330
};
311331
};
312-
case 29: {
313-
if (commandpointsblu1 >= 5) then {
314-
hint "Vehicle ready !";
315-
commandpointsblu1 = commandpointsblu1 - 5;
316-
ctrlSetText [1000, format["%1",commandpointsblu1]];
317-
_vehic = "B_UAV_01_F" createVehicle _spawnPos; createVehicleCrew _vehic;
318-
} else {
319-
hint "Not enough command points";
320-
};
321-
};
322-
case 30: { // Prowler Unarmed
323-
if (commandpointsblu1 >= 5) then {
324-
hint "Vehicle ready !";
325-
commandpointsblu1 = commandpointsblu1 - 100;
326-
ctrlSetText [1000, format["%1",commandpointsblu1]];
327-
_vehic = "B_T_LSV_01_unarmed_F" createVehicle _spawnPos;
328-
} else {
329-
hint "Not enough command points";
330-
};
331-
};
332-
case 31: { // Prowler Armed
333-
if (commandpointsblu1 >= 100) then {
334-
hint "Vehicle ready !";
335-
commandpointsblu1 = commandpointsblu1 - 100;
336-
ctrlSetText [1000, format["%1",commandpointsblu1]];
337-
_vehic = "B_T_LSV_01_armed_F" createVehicle _spawnPos;
338-
} else {
339-
hint "Not enough command points";
340-
};
341-
};
342-
case 32: {
332+
case 31: { // MQ-12 Falcon
343333
if (commandpointsblu1 >= 100) then {
344334
hint "Vehicle ready !";
345335
commandpointsblu1 = commandpointsblu1 - 100;
346336
ctrlSetText [1000, format["%1",commandpointsblu1]];
347-
_vehic = "B_T_LSV_01_armed_F" createVehicle _spawnPos;
337+
_vehic = "B_T_UAV_03_F" createVehicle _spawnPos; createVehicleCrew _vehic;
348338
} else {
349339
hint "Not enough command points";
350340
};
351341
};
352-
case 33: {
353-
if (commandpointsblu1 >= 100) then {
342+
case 32: { // Darter UAV
343+
if (commandpointsblu1 >= 5) then {
354344
hint "Vehicle ready !";
355-
commandpointsblu1 = commandpointsblu1 - 100;
345+
commandpointsblu1 = commandpointsblu1 - 5;
356346
ctrlSetText [1000, format["%1",commandpointsblu1]];
357-
_vehic = "B_T_LSV_01_armed_F" createVehicle _spawnPos;
347+
_vehic = "B_UAV_01_F" createVehicle _spawnPos; createVehicleCrew _vehic;
358348
} else {
359349
hint "Not enough command points";
360350
};
361351
};
362-
case 34: { // Blackfish (Infantry)
352+
case 33: { // Blackfish (Infantry)
363353
if (commandpointsblu1 >= 100) then {
364354
hint "Vehicle ready !";
365355
commandpointsblu1 = commandpointsblu1 - 100;
@@ -369,7 +359,7 @@ switch (_index) do {
369359
hint "Not enough command points";
370360
};
371361
};
372-
case 35: { // Blackfish (Vehicle)
362+
case 34: { // Blackfish (Vehicle)
373363
if (commandpointsblu1 >= 100) then {
374364
hint "Vehicle ready !";
375365
commandpointsblu1 = commandpointsblu1 - 100;
@@ -379,7 +369,7 @@ switch (_index) do {
379369
hint "Not enough command points";
380370
};
381371
};
382-
case 36: { // Blackfish (Armed)
372+
case 35: { // Blackfish (Armed)
383373
if (commandpointsblu1 >= 100) then {
384374
hint "Vehicle ready !";
385375
commandpointsblu1 = commandpointsblu1 - 100;
@@ -389,16 +379,6 @@ switch (_index) do {
389379
hint "Not enough command points";
390380
};
391381
};
392-
case 37: { // MQ-12 Falcon
393-
if (commandpointsblu1 >= 100) then {
394-
hint "Vehicle ready !";
395-
commandpointsblu1 = commandpointsblu1 - 100;
396-
ctrlSetText [1000, format["%1",commandpointsblu1]];
397-
_vehic = "B_T_UAV_03_F" createVehicle _spawnPos; createVehicleCrew _vehic;
398-
} else {
399-
hint "Not enough command points";
400-
};
401-
};
402382
};
403383
publicVariable "commandpointsblu1";
404384
//hint format["index: %1",_index];

0 commit comments

Comments
 (0)