Advertisement
Guest User

Untitled

a guest
Jun 21st, 2014
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.46 KB | None | 0 0
  1. // Mission Budget Script V 2.0 by Fr33d0m. www.mediusgaming.com
  2. // Assisted by Corello
  3. //###################
  4. // Rank ###### Rating
  5. //###################
  6. //PRIVATE 0
  7. //CORPORAL 50
  8. //SERGEANT 150
  9. //LIEUTENANT 250
  10. //CAPTAIN 350
  11. //MAJOR 500
  12. //COLONEL 750
  13. //
  14. //License:
  15. //You may use and alter this script, but you may not redistribute. You may distribute this script as a part of your mission, with proper credits given.
  16. //Arma 3 Defense Budget Script AKA TMN Economy Script by:
  17. //
  18. // Developer: TMN Fr33d0m
  19. // Assisted by: Corello
  20. //
  21. //www.mediusgaming.com (The Medius Network)
  22. //All Right Reserved
  23. //
  24. //For Information and Inquiries, EMAIL: admin@tmnclan.com
  25. //################################## LET US BEGIN ####################################
  26.  
  27. //Addon Options
  28. DAR_HMMWV_Support_Enabled = 1;
  29.  
  30. /////////////////////////////////////////////////////////////////////////////////////
  31. //Initial Budget for Side
  32.  
  33. B_initialbudget= 1000000000;
  34.  
  35. //Rating to Purchase Values
  36.  
  37. B_vaslimit= 1500;
  38. B_Mlimit= 3500;
  39. B_Llimit= 5500;
  40.  
  41. // Big Ticket Item (Locked to a rank)
  42. B_maxrank = "MAJOR";
  43.  
  44. //////////////////////////////////////////////////////////////////////////////////////
  45. //Monetary Costs of things:
  46.  
  47. //Items
  48. Bvascost= 10000;
  49. Bsupplycrate= 500;
  50. Bammocrate= 750;
  51.  
  52. //Cars and Trucks
  53. HunterUnarmed= 470000;
  54. HunterHMG= 500000;
  55. HunterGMG= 520000;
  56. HEMTTcov= 125000;
  57. HEMTTopn= 90000;
  58. BATV= 7500;
  59. COffRoad= 32000;
  60.  
  61. //Armor
  62. M2A1= 6000000;
  63. Sandstorm= 2410000;
  64. AMV7 = 3150000;
  65. IFV6c= 3000000;
  66. IFV6a= 3800000;
  67.  
  68. //Helicopters and Planes
  69. AH99= 12100000;
  70. UH80= 21300000;
  71. AH9= 2300000;
  72. MH9= 2000000;
  73. A164 = 11800000;
  74.  
  75. //DAR HMMWV
  76. DAR_M1151 = 70000;
  77. DAR_M1151_Deploy = 72000;
  78. DAR_M1151Woodland = 72000;
  79. DAR_M115_MK19 = 81000;
  80. DAR_M115_MK19Woodland = 81000;
  81. DAR_M1151WoodlandUA = 79000;
  82. DAR_M1152 = 64000;
  83. DAR_M1152Woodland = 66000;
  84. DAR_M1165_GMV = 77000;
  85. DAR_M1167 = 83000;
  86. DAR_M1167Woodland = 83000;
  87.  
  88. //////////////////////////////////////////////////////////////////////////////////////////////////
  89. //Initial Budget Creator
  90. ////////////////////////////////////////////////////////////////////////////////////////////////
  91.  
  92. if (isnil "B_defensebudget") then {
  93. B_defensebudget= B_initialbudget;
  94. publicVariable "B_defensebudget";
  95. };
  96.  
  97. if (isnil "B_totalcost") then {
  98. B_totalcost= 0;
  99. publicVariable "B_totalcost";
  100. };
  101.  
  102. ///////////////////////////////////////////////////////////////////////////////////////////
  103. //Number Conversion by Corello
  104.  
  105. TMN_handle_number=
  106. {
  107. private ["_number","_mod","_digots","_digitsCount","_modBase","_numberText"];
  108.  
  109. _number = [_this,0,0,[0]] call bis_fnc_param;
  110. _mod = [_this,1,3,[0]] call bis_fnc_param;
  111.  
  112. _digits = _number call bis_fnc_numberDigits;
  113. _digitsCount = count _digits - 1;
  114.  
  115. _modBase = _digitsCount % _mod;
  116. _numberText = "";
  117. {
  118. _numberText = _numberText + str _x;
  119. if ((_foreachindex - _modBase) % (_mod) == 0 && _foreachindex != _digitsCount) then {_numberText = _numberText + ",";};
  120. } foreach _digits;
  121. _numberText
  122. };
  123.  
  124. /////////////////////////////////////////////////////////////////////////////////////////////
  125. // Define what numbers are converted
  126.  
  127.  
  128.  
  129.  
  130. ///////////////////////////////////////////////////////////////////////////////////////////
  131. // Open Dialog
  132. _handle= CreateDialog "TMN_store";
  133. playMusic "gearup";
  134.  
  135. ///////////////////////////////////////////////////////////////////////////////////////////
  136. // Menu Music Killer
  137. tmn_fnc_silence = {
  138. playMusic "";
  139. };
  140.  
  141. //////////////////////////////////////////////////////////////////////////////////////////////
  142. // Temporary VAS Access
  143.  
  144. tempaccess =
  145. {
  146. vasholder = B_vaslimit;
  147. publicVariable "vasholder";
  148. sleep 1.0;
  149. B_vaslimit = 0;
  150. publicVariable "B_vaslimit";
  151. hint "You have temporarily allowed VAS access to all players with a 0 or above rating. This authorization will remain effective for 5 minutes";
  152. sleep 300.0;
  153. hint "Open VAS Access authorization has expired";
  154. B_vaslimit = vasholder;
  155. publicVariable "B_vaslimit";
  156. };
  157.  
  158. ///////////////////////////////////////////////////////////////////////////////////////////
  159. //Update Budget Balance in GUI
  160.  
  161. DoBudget = {
  162. //Get the dialog display (a viewport)
  163. _Bdisplay = findDisplay 420;
  164.  
  165. if (str (_Bdisplay) != "no display") then
  166. {
  167. _ChildControl = _Bdisplay displayCtrl 1100;
  168. //Change It
  169. form_B_defensebudget= [B_defensebudget] call TMN_handle_number;
  170. _ChildControl ctrlSetStructuredText parseText format ["$%1", form_B_defensebudget];
  171. };
  172. };
  173.  
  174. [] call DoBudget;
  175.  
  176. ///////////////////////////////////////////////////////////////////////////////////////////
  177. //Update Total Balance in GUI
  178.  
  179. DoTotal = {
  180. //Get the dialog display (a viewport)
  181. _BTdisplay = findDisplay 420;
  182.  
  183. if (str (_BTdisplay) != "no display") then
  184. {
  185. _ChildControl2 = _BTdisplay displayCtrl 1101;
  186. //Change It
  187. form_B_totalcost= [B_totalcost] call TMN_handle_number;
  188. _ChildControl2 ctrlSetStructuredText parseText format ["$%1", form_B_totalcost];
  189. };
  190. };
  191.  
  192. [] call DoTotal;
  193.  
  194. //////////////////////////////////////////////////////////////////////////////////////////
  195. //Show Current Rank in GUI
  196.  
  197. DoRankChk = {
  198. //Get the dialog display (a viewport)
  199. _BRdisplay = findDisplay 420;
  200.  
  201. if (str (_BRdisplay) != "no display") then
  202. {
  203. _ChildControl3 = _BRdisplay displayCtrl 1102;
  204. //Change It
  205. _prank = rank player;
  206. _Pnum = rating player;
  207. _ChildControl3 ctrlSetStructuredText parseText format ["Rank is %1<br />Rating is %2", _prank, _Pnum];
  208. };
  209. };
  210.  
  211. [] call DoRankChk;
  212.  
  213. //////////////////////////////////////////////////////////////////////////////////////////////
  214. //Rank Allow VAS for all
  215.  
  216. VASchk = {
  217. _prat = rank Player;
  218. if (_prat != B_Maxrank) then {hint format ["You do not have the proper rank (Min Rank %1) to allow VAS access to team", B_Maxrank]} else {[] spawn tempaccess}
  219. };
  220.  
  221. //////////////////////////////////////////////////////////////////////////////////////////////////
  222. //Rank Show Creds for Rating
  223. Showcreds= {
  224. _prank = rank player;
  225. if (_prank != B_maxrank) then {hint format ["Umm, your credentials aren't very impressive. You must be the %1 to get automatic rating points.", B_maxrank]} else {hint format ["Welcome, %1! You have been appropriated Max rating points", B_maxrank]; player addRating 9999; [] call DoRankChk;};
  226. };
  227.  
  228. ////////////////////////////////////////////////////////////////////////////////////////////////////
  229. //VAS Ammobox access
  230. VasOpen={
  231. _prat = rating player; if ((B_defensebudget< Bvascost) OR (_prat< B_vaslimit)) then {hint format ["You do not have sufficient rating (Min Rating %1) or money (Costs $%2) to do this.", B_vaslimit, Bvascost]} else {execVM "VAS\open.sqf"; B_defensebudget= (B_defensebudget-Bvascost); publicVariable "B_defensebudget"; B_totalcost= (B_totalcost+Bvascost); publicVariable "B_totalcost";}
  232. };
  233.  
  234. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  235. //Add Wheeled Vehicles to Main List
  236.  
  237. DoAddWheel = {
  238. wheelson = 1;
  239. wingson = 0;
  240. helion = 0;
  241. armoredon = 0;
  242. lbClear 1500;
  243. _index1= lbAdd [1500, "MAT-V Unarmed Vehicle - $470,000.00"];
  244. _index2= lbAdd [1500, "MAT-V Armed (.50 HMG) - $500,000.00"];
  245. _index3 = lbAdd [1500, "MAT-V Armed (40mm GMG) - $520,000.00"];
  246. _index4 = lbAdd [1500, "HEMTT Troop Transport - Covered - $125,000.00"];
  247. _index5 = lbAdd [1500, "HEMTT Troop Transport - Open - $90,000.00"];
  248. _index6 = lbAdd [1500, "ATV - $7,500.00"];
  249. _index7 = lbAdd [1500, "Civilian Offroad - $32,000.00"];
  250.  
  251. if (DAR_HMMWV_Support_Enabled == 1) then {
  252. _index8 = lbAdd [1500, "HMMWV M1151 - $70,000.00"];
  253. _index9 = lbAdd [1500, "HMMWV M1151 Deploy - $72,000.00"];
  254. _index10 = lbAdd [1500, "HMMWV M1151 Woodland - $72,000.00"];
  255. _index11= lbAdd [1500, "HMMWV M1115 MK19 - $81,000.00"];
  256. _index12= lbAdd [1500, "HMMWV M1115 MK19 Woodland - $81,000.00"];
  257. _index13 = lbAdd [1500, "HMMWV M1151 Woodland UA - $79,000.00"];
  258. _index14 = lbAdd [1500, "HMMWV M1152 - $64,000.00"];
  259. _index15 = lbAdd [1500, "HMMWV M1152 Woodland - $66,000.00"];
  260. _index16 = lbAdd [1500, "HMMWV M1165 GMV - $77,000.00"];
  261. _index17 = lbAdd [1500, "HMMWV M1167 - $83,000.00"];
  262. _index18 = lbAdd [1500, "HMMWV M1167 Woodland - $83,000.00"];
  263. };
  264. };
  265.  
  266. ////////////////////////////////////////////////////////////////////////////////////////////////////////
  267. //Add Fixed Wing to Main List
  268.  
  269. DoAddFixedWing = {
  270. wheelson = 0;
  271. wingson = 1;
  272. helion = 0;
  273. armoredon = 0;
  274. lbClear 1500;
  275. _index19= lbAdd [1500, "A-164 Wipeout Anti-Tank Aircraft - $11,800,000.00"];
  276. };
  277.  
  278. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  279. //Add Rotary Aircraft to Main List
  280.  
  281. DoAddRotary = {
  282. wheelson = 0;
  283. wingson = 0;
  284. helion = 1;
  285. armoredon = 0;
  286. lbClear 1500;
  287. _index20= lbAdd [1500, "AH-99 Blackfoot Attack Helicopter - $12,100,000.00"];
  288. _index21= lbAdd [1500, "UH-80 Ghosthawk Combat Transport Helicopter - $21,300,000.00"];
  289. _index22 = lbAdd [1500, "AH-9 Pawnee Combat Support Helicopter - $2,300,000.00"];
  290. _index23 = lbAdd [1500, "MH-9 Hummingbird Light Transport Helicopter - $2,000,000.00"];
  291.  
  292. };
  293.  
  294. /////////////////////////////////////////////////////////////////////////////////////////////////////////
  295. //Add Armored Vehicles to Main List
  296.  
  297. DoAddArmored = {
  298. wheelson = 0;
  299. wingson = 0;
  300. helion = 0;
  301. armoredon = 1;
  302. lbClear 1500;
  303. _index24= lbAdd [1500, "M2A1 Slammer Battle Tank = $6,000,000.00"];
  304. _index25= lbAdd [1500, "M5 Sandstorm MLRS - $2,410,000.00"];
  305. _index26 = lbAdd [1500, "AMV-7 Amphibious APC - $3,150,000.00"];
  306. _index27 = lbAdd [1500, "IFV-6c Panther APC - $3,000,000.00"];
  307. _index28 = lbAdd [1500, "IFV-6a Cheetah AA Tank - $3,800,000.00"];
  308. };
  309.  
  310. //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  311. // Handle the menu clicks (Parent class)
  312.  
  313. TMN_fnc_handleClick = {
  314. TheSelection = _this select 1;
  315. hint format ["Handle Click Activated. Variable passed was %1", TheSelection];
  316. if (wheelson == 1) then {_this call TMN_fnc_wheeled;};
  317. if (wingson == 1) then {_this call TMN_fnc_winged;};
  318. if (helion == 1) then {_this call TMN_fnc_heli;};
  319. if (armoredon == 1) then {_this call TMN_fnc_Armor};
  320. };
  321.  
  322. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  323. // Handle Wheeled Vehicles
  324.  
  325. TMN_fnc_wheeled ={
  326. //DEBUG (Uncomment to use)
  327.  
  328. switch (TheSelection) do {
  329.  
  330. case 0: {
  331. _prat = rating player;
  332. if ((B_defensebudget< HunterUnarmed) OR (_prat < B_Llimit))
  333. then
  334. {hint format ["You do not have sufficient rating (Min Rating %1) or money (Costs $%2) to do this.", B_Llimit, HunterUnarmed]}
  335. else {_MATV= "B_MRAP_01_F" createVehicle (getMarkerPos "vehspawn");
  336. B_defensebudget= (B_defensebudget-HunterUnarmed);
  337. publicVariable "B_defensebudget";
  338. B_totalcost= (B_totalcost+HunterUnarmed);
  339. publicVariable "B_totalcost";
  340. hint format ["You have purchased an unarmed Hunter for $%1", HunterUnarmed];};
  341. [] call doBudget; [] call DoTotal;
  342. };
  343.  
  344. case 1: {
  345. _prat = rating player;
  346. if ((B_defensebudget< HunterHMG) OR (_prat < B_Llimit))
  347. then
  348. {hint format ["You do not have sufficient rating (Min Rating %1) or money (Costs $%2) to do this.", B_Llimit, HunterHMG]}
  349. else
  350. {_MATV= "B_MRAP_01_hmg_F" createVehicle (getMarkerPos "vehspawn");
  351. _MATV setVehicleLock "UNLOCKED";
  352. B_defensebudget= (B_defensebudget-HunterHMG);
  353. publicVariable "B_defensebudget";
  354. B_totalcost= (B_totalcost+HunterHMG);
  355. publicVariable "B_totalcost";
  356. hint format ["You have purchased an Armed Hunter (.50 HMG) for $%1", HunterHMG];};
  357. [] call doBudget; [] call DoTotal;
  358. };
  359.  
  360. case 2: {
  361. _prat = rating player;
  362. if ((B_defensebudget< HunterGMG) OR (_prat < B_Llimit))
  363. then
  364. {hint format ["You do not have sufficient rating (Min Rating %1) or money (Costs $%2) to do this.", B_Llimit, HunterGMG]}
  365. else
  366. {_MATV= "B_MRAP_01_gmg_F" createVehicle (getMarkerPos "vehspawn");
  367. _MATV setVehicleLock "UNLOCKED";
  368. B_defensebudget= (B_defensebudget-HunterGMG);
  369. publicVariable "B_defensebudget";
  370. B_totalcost= (B_totalcost+HunterGMG);
  371. publicVariable "B_totalcost";
  372. hint format ["You have purchased an Armed Hunter (40mm GMG) for $%1", HunterGMG];};
  373. [] call doBudget; [] call DoTotal;
  374. };
  375.  
  376. case 3: {
  377. _prat = rating player;
  378. if ((B_defensebudget< HEMTTcov) OR (_prat < B_Mlimit))
  379. then
  380. {hint format ["You do not have sufficient rating (Min Rating %1) or money (Costs $%2) to do this.", B_Mlimit, HEMTTcov]}
  381. else
  382. {_MATV= "B_Truck_01_covered_F" createVehicle (getMarkerPos "vehspawn");
  383. _MATV setVehicleLock "UNLOCKED";
  384. B_defensebudget= (B_defensebudget-HEMTTcov);
  385. publicVariable "B_defensebudget";
  386. B_totalcost= (B_totalcost+HEMTTcov);
  387. publicVariable "B_totalcost";
  388. hint format ["You have purchased a covered HEMTT Transport for $%1", HEMTTcov];
  389. [] call doBudget; [] call DoTotal;
  390. };
  391. };
  392.  
  393. case 4: {
  394. _prat = rating player;
  395. if ((B_defensebudget< HEMTTopn) OR (_prat < B_Mlimit))
  396. then
  397. {hint format ["You do not have sufficient rating (Min Rating %1) or money (Costs $%2) to do this.", B_Mlimit, HEMTTopn]}
  398. else
  399. {_MATV= "B_Truck_01_transport_F" createVehicle (getMarkerPos "vehspawn");
  400. _MATV setVehicleLock "UNLOCKED";
  401. B_defensebudget= (B_defensebudget-HEMTTopn);
  402. publicVariable "B_defensebudget";
  403. B_totalcost= (B_totalcost+HEMTTopn);
  404. publicVariable "B_totalcost";
  405. hint format ["You have purchased a open HEMTT Transport for $90,000.00", HEMTTopn];
  406. [] call doBudget; [] call DoTotal;
  407. };
  408. };
  409.  
  410. case 5: {
  411. _prat = rating player;
  412. if ((B_defensebudget< BATV) OR (_prat < B_Mlimit)) then {hint format ["You do not have sufficient rating (Min Rating %1) or money (Costs $%2) to do this.", B_Mlimit, BATV]}
  413. else
  414. {_MATV= "B_Quadbike_01_F" createVehicle (getMarkerPos "vehspawn");
  415. _MATV setVehicleLock "UNLOCKED";
  416. B_defensebudget= (B_defensebudget-BATV);
  417. publicVariable "B_defensebudget";
  418. B_totalcost= (B_totalcost+BATV);
  419. publicVariable "B_totalcost";
  420. hint format ["You have purchased an ATV for $%1", BATV];
  421. [] call doBudget; [] call DoTotal;
  422. };
  423. };
  424.  
  425. case 6: {
  426. _prat = rating player;
  427. if ((B_defensebudget< DAR_M1151) OR (_prat < B_Llimit))
  428. then
  429. {hint format ["You do not have sufficient rating (Min Rating %1) or money (Costs $%2) to do this.", B_Llimit, DAR_M1151]}
  430. else
  431. {_MATV= "DAR_M1151" createVehicle (getMarkerPos "vehspawn");
  432. _MATV setVehicleLock "UNLOCKED";
  433. B_defensebudget= (B_defensebudget-DAR_M1151);
  434. publicVariable "B_defensebudget";
  435. B_totalcost= (B_totalcost+DAR_M1151);
  436. publicVariable "B_totalcost";
  437. hint format ["You have purchased a HMMWV M1151 for $%1", DAR_M1151];
  438. [] call doBudget; [] call DoTotal;
  439. };
  440. };
  441.  
  442. case 7: {
  443. _prat = rating player;
  444. if ((B_defensebudget< DAR_M1151_Deploy) OR (_prat < B_Llimit))
  445. then
  446. {hint format ["You do not have sufficient rating (Min Rating %1) or money (Costs $%2) to do this.", B_Llimit, DAR_M1151_Deploy]}
  447. else
  448. {_MATV= "DAR_M1151_Deploy" createVehicle (getMarkerPos "vehspawn");
  449. _MATV setVehicleLock "UNLOCKED";
  450. B_defensebudget= (B_defensebudget-DAR_M1151_Deploy);
  451. publicVariable "B_defensebudget";
  452. B_totalcost= (B_totalcost+DAR_M1151_Deploy);
  453. publicVariable "B_totalcost";
  454. hint format ["You have purchased a HMMWV M1151 Deploy for $%1", DAR_M1151_Deploy];
  455. [] call doBudget; [] call DoTotal;
  456. };
  457. };
  458.  
  459. case 8: {
  460. _prat = rating player;
  461. if ((B_defensebudget< DAR_M1151Woodland) OR (_prat < B_Llimit))
  462. then
  463. {hint format ["You do not have sufficient rating (Min Rating %1) or money (Costs $%2) to do this.", B_Llimit, DAR_M1151Woodland]}
  464. else
  465. {_MATV= "DAR_M1151Woodland" createVehicle (getMarkerPos "vehspawn");
  466. _MATV setVehicleLock "UNLOCKED";
  467. B_defensebudget= (B_defensebudget-DAR_M1151Woodland);
  468. publicVariable "B_defensebudget";
  469. B_totalcost= (B_totalcost+DAR_M1151Woodland);
  470. publicVariable "B_totalcost";
  471. hint format ["You have purchased a HMMWV M1151 Woodland for $%1", DAR_M1151Woodland];
  472. [] call doBudget; [] call DoTotal;
  473. };
  474. };
  475.  
  476. case 9: {
  477. _prat = rating player;
  478. if ((B_defensebudget< DAR_M115_MK19) OR (_prat < B_Llimit))
  479. then
  480. {hint format ["You do not have sufficient rating (Min Rating %1) or money (Costs $%2) to do this.", B_Llimit, DAR_M115_MK19]}
  481. else
  482. {_MATV= "DAR_M115_MK19" createVehicle (getMarkerPos "vehspawn");
  483. _MATV setVehicleLock "UNLOCKED";
  484. B_defensebudget= (B_defensebudget-DAR_M115_MK19);
  485. publicVariable "B_defensebudget";
  486. B_totalcost= (B_totalcost+DAR_M115_MK19);
  487. publicVariable "B_totalcost";
  488. hint format ["You have purchased a HMMWV M1151 MK19 for $%1", DAR_M115_MK19];
  489. [] call doBudget; [] call DoTotal;
  490. };
  491. };
  492.  
  493. case 10: {
  494. _prat = rating player;
  495. if ((B_defensebudget< DAR_M115_MK19Woodland) OR (_prat < B_Llimit))
  496. then
  497. {hint format ["You do not have sufficient rating (Min Rating %1) or money (Costs $%2) to do this.", B_Llimit, DAR_M115_MK19Woodland]}
  498. else
  499. {_MATV= "DAR_M115_MK19Woodland" createVehicle (getMarkerPos "vehspawn");
  500. _MATV setVehicleLock "UNLOCKED";
  501. B_defensebudget= (B_defensebudget-DAR_M115_MK19Woodland);
  502. publicVariable "B_defensebudget";
  503. B_totalcost= (B_totalcost+DAR_M115_MK19Woodland);
  504. publicVariable "B_totalcost";
  505. hint format ["You have purchased a HMMWV M1151 Woodland MK19 for $%1", DAR_M115_MK19Woodland];
  506. [] call doBudget; [] call DoTotal;
  507. };
  508. };
  509.  
  510. case 11; {
  511. _prat = rating player;
  512. if ((B_defensebudget< DAR_M1151WoodlandUA) OR (_prat < B_Llimit))
  513. then
  514. {hint format ["You do not have sufficient rating (Min Rating %1) or money (Costs $%2) to do this.", B_Llimit, DAR_M1151WoodlandUA]}
  515. else {_MATV= "DAR_M1151WoodlandUA" createVehicle (getMarkerPos "vehspawn");
  516. _MATV setVehicleLock "UNLOCKED";
  517. B_defensebudget= (B_defensebudget-DAR_M1151WoodlandUA);
  518. publicVariable "B_defensebudget";
  519. B_totalcost= (B_totalcost+DAR_M1151WoodlandUA);
  520. publicVariable "B_totalcost";
  521. hint format ["You have purchased a HMMWV M1151 Woodland UA for $%1", DAR_M1151WoodlandUA];
  522. [] call doBudget; [] call DoTotal;
  523. };
  524. };
  525.  
  526. case 12: {
  527. _prat = rating player;
  528. if ((B_defensebudget< DAR_M1152) OR (_prat < B_Llimit))
  529. then
  530. {hint format ["You do not have sufficient rating (Min Rating %1) or money (Costs $%2) to do this.", B_Llimit, DAR_M1152]}
  531. else
  532. {_MATV= "DAR_M1152" createVehicle (getMarkerPos "vehspawn");
  533. _MATV setVehicleLock "UNLOCKED";
  534. B_defensebudget= (B_defensebudget-DAR_M1152);
  535. publicVariable "B_defensebudget";
  536. B_totalcost= (B_totalcost+DAR_M1152);
  537. publicVariable "B_totalcost";
  538. hint format ["You have purchased a HMMWV M1152 for $%1", DAR_M1152];
  539. [] call doBudget; [] call DoTotal;
  540. };
  541. };
  542.  
  543. case 13: {
  544. _prat = rating player;
  545. if ((B_defensebudget< DAR_M1152Woodland) OR (_prat < B_Llimit))
  546. then
  547. {hint format ["You do not have sufficient rating (Min Rating %1) or money (Costs $%2) to do this.", B_Llimit, DAR_M1152Woodland]}
  548. else
  549. {_MATV= "DAR_M1152Woodland" createVehicle (getMarkerPos "vehspawn");
  550. _MATV setVehicleLock "UNLOCKED";
  551. B_defensebudget= (B_defensebudget-DAR_M1152Woodland);
  552. publicVariable "B_defensebudget";
  553. B_totalcost= (B_totalcost+DAR_M1152Woodland);
  554. publicVariable "B_totalcost";
  555. hint format ["You have purchased a HMMWV M1152 Woodland for $%1", DAR_M1152Woodland];
  556. [] call doBudget; [] call DoTotal;
  557. };
  558. };
  559.  
  560. case 14: {
  561. _prat = rating player;
  562. if ((B_defensebudget< DAR_M1165_GMV) OR (_prat < B_Llimit))
  563. then
  564. {hint format ["You do not have sufficient rating (Min Rating %1) or money (Costs $%2) to do this.", B_Llimit, DAR_M1165_GMV]}
  565. else
  566. {_MATV= "DAR_M1165_GMV" createVehicle (getMarkerPos "vehspawn");
  567. _MATV setVehicleLock "UNLOCKED";
  568. B_defensebudget= (B_defensebudget-DAR_M1165_GMV);
  569. publicVariable "B_defensebudget";
  570. B_totalcost= (B_totalcost+DAR_M1165_GMV);
  571. publicVariable "B_totalcost";
  572. hint format ["You have purchased a HMMWV M1165 GMV Deploy for $%1", DAR_M1165_GMV];
  573. [] call doBudget; [] call DoTotal;
  574. };
  575. };
  576.  
  577. case 15: {
  578. _prat = rating player;
  579. if ((B_defensebudget< DAR_M1167) OR (_prat < B_Llimit))
  580. then
  581. {hint format ["You do not have sufficient rating (Min Rating %1) or money (Costs $%2) to do this.", B_Llimit, DAR_M1167]}
  582. else
  583. {_MATV= "DAR_M1167" createVehicle (getMarkerPos "vehspawn");
  584. _MATV setVehicleLock "UNLOCKED";
  585. B_defensebudget= (B_defensebudget-DAR_M1167);
  586. publicVariable "B_defensebudget";
  587. B_totalcost= (B_totalcost+DAR_M1167);
  588. publicVariable "B_totalcost";
  589. hint format ["You have purchased a HMMWV M1167 for $%1", DAR_M1167];
  590. [] call doBudget; [] call DoTotal;
  591. };
  592. };
  593.  
  594. case 16: {
  595. _prat = rating player;
  596. if ((B_defensebudget< DAR_M1167Woodland) OR (_prat < B_Llimit))
  597. then
  598. {hint format ["You do not have sufficient rating (Min Rating %1) or money (Costs $%2) to do this.", B_Llimit, DAR_M1167Woodland]}
  599. else
  600. {_MATV= "DAR_M1167Woodland" createVehicle (getMarkerPos "vehspawn");
  601. _MATV setVehicleLock "UNLOCKED";
  602. B_defensebudget= (B_defensebudget-DAR_M1167Woodland);
  603. publicVariable "B_defensebudget";
  604. B_totalcost= (B_totalcost+DAR_M1167Woodland);
  605. publicVariable "B_totalcost";
  606. hint format ["You have purchased a HMMWV M1167 Woodland for $%1", DAR_M1167Woodland];
  607. [] call doBudget; [] call DoTotal;
  608. };
  609. };
  610.  
  611. case 17: {
  612. _prat = rating player;
  613. if ((B_defensebudget< COffRoad) OR (_prat < B_Mlimit)) then {hint format ["You do not have sufficient rating (Min Rating %1) or money (Costs $%2) to do this.", B_Mlimit, COffRoad]}
  614. else
  615. {_MATV= "C_Offroad_01_F" createVehicle (getMarkerPos "vehspawn");
  616. _MATV setVehicleLock "UNLOCKED";
  617. B_defensebudget= (B_defensebudget-COffRoad);
  618. publicVariable "B_defensebudget";
  619. B_totalcost= (B_totalcost+COffRoad);
  620. publicVariable "B_totalcost";
  621. hint format ["You have purchased an Civilian Offroad for $%1", COffRoad];
  622. [] call doBudget; [] call DoTotal;
  623. };
  624. };
  625.  
  626. default { hint "Something went wrong...Couldn't find case for selection!" };
  627.  
  628. // Last Bracket For Wheeled Case
  629. };
  630. };
  631.  
  632. //////////////////////////////////////////////////////////////////////
  633. //Handle Winged
  634.  
  635. TMN_fnc_winged= {
  636.  
  637. switch (TheSelection) do {
  638.  
  639. case 0: {
  640. form_A164= [A164] call TMN_handle_number;
  641. _prat = rank player;
  642. if ((B_defensebudget < A164) OR (_prat != B_Maxrank))
  643. then
  644. {hint format ["You do not have sufficient rank (Min Rank %1) or money (Costs $%2) to do this.", B_maxrank, form_A164]}
  645. else
  646. {_MATV= "B_Plane_CAS_01_F" createVehicle (getMarkerPos "airspawn");
  647. B_defensebudget= (B_defensebudget-A164);
  648. publicVariable "B_defensebudget";
  649. B_totalcost= (B_totalcost+A164);
  650. publicVariable "B_totalcost";
  651. hint format ["You have purchased a A164 Wipeout for $%1", form_A164];
  652. [] call doBudget; [] call DoTotal;
  653. };
  654. };
  655.  
  656. default { hint "Something went wrong...Couldn't find case for selection!" };
  657.  
  658. //Last Bracket for Winged Case
  659. };
  660. };
  661.  
  662. //////////////////////////////////////////////////////////////////////
  663. //Handle Heli
  664.  
  665. TMN_fnc_heli= {
  666.  
  667. switch (TheSelection) do {
  668.  
  669. case 0: {
  670. form_AH99= [AH99] call TMN_handle_number;
  671. _prat = rank player;
  672. if ((B_defensebudget < AH99) OR (_prat != B_Maxrank)) then {hint format ["You do not have sufficient rank (Min Rank %1) or money (Costs $%2) to do this.", B_maxrank, form_AH99]}
  673. else
  674. {_MATV= "B_Heli_Attack_01_F" createVehicle (getMarkerPos "chspawn");
  675. B_defensebudget= (B_defensebudget-AH99);
  676. publicVariable "B_defensebudget";
  677. B_totalcost= (B_totalcost+AH99);
  678. publicVariable "B_totalcost";
  679. hint format ["You have purchased a AH-99 Blackfoot for $%1", form_AH99];
  680. [] call doBudget; [] call DoTotal;
  681. };
  682. };
  683.  
  684. case 1: {
  685. form_UH80= [UH80] call TMN_handle_number;
  686. _prat = rank player;
  687. if ((B_defensebudget< UH80) OR (_prat != B_Maxrank)) then {hint format ["You do not have sufficient rank (Min Rank %1) or money (Costs $%2) to do this.", B_maxrank, form_UH80]}
  688. else
  689. {_MATV= "B_Heli_Transport_01_F" createVehicle (getMarkerPos "chspawn");
  690. B_defensebudget= (B_defensebudget-UH80);
  691. publicVariable "B_defensebudget";
  692. B_totalcost= (B_totalcost+UH80);
  693. publicVariable "B_totalcost";
  694. hint format ["You have purchased a UH-80 Ghosthawk for $%1", form_UH80];
  695. [] call doBudget; [] call DoTotal;
  696. };
  697. };
  698.  
  699. case 2: {
  700. form_AH9= [AH9] call TMN_handle_number;
  701. _prat = rank player;
  702. if ((B_defensebudget< AH9) OR (_prat != B_Maxrank)) then {hint format ["You do not have sufficient rank (Min Rank %1) or money (Costs $%2) to do this.", B_maxrank, AH9]}
  703. else
  704. {_MATV= "B_Heli_Light_01_armed_F" createVehicle (getMarkerPos "chspawn");
  705. B_defensebudget= (B_defensebudget-AH9);
  706. publicVariable "B_defensebudget";
  707. B_totalcost= (B_totalcost+AH9);
  708. publicVariable "B_totalcost";
  709. hint format ["You have purchased an AH-9 Pawnee for $%1", form_AH9];
  710. [] call doBudget; [] call DoTotal;
  711. };
  712. };
  713.  
  714. case 3: {
  715. form_MH9= [MH9] call TMN_handle_number;
  716. _prat = rank player;
  717. if ((B_defensebudget< MH9) OR (_prat != B_Maxrank)) then {hint format ["You do not have sufficient rank (Min Rank %1) or money (Costs $%2) to do this.", B_maxrank, form_MH9]}
  718. else
  719. {_MATV= "B_Heli_Light_01_F" createVehicle (getMarkerPos "chspawn");
  720. B_defensebudget= (B_defensebudget-MH9);
  721. publicVariable "B_defensebudget";
  722. B_totalcost= (B_totalcost+MH9);
  723. publicVariable "B_totalcost";
  724. hint format ["You have purchased an MH-9 Hummingbird for $%1", form_MH9];
  725. [] call doBudget; [] call DoTotal;
  726. };
  727. };
  728.  
  729. default { hint "Something went wrong...Couldn't find case for selection!" };
  730. };
  731. };
  732.  
  733. //////////////////////////////////////////////////////////////////////
  734. //Handle Armor
  735.  
  736. TMN_fnc_armor= {
  737.  
  738. switch (TheSelection) do {
  739.  
  740. case 0: {
  741. form_M2A1= [M2A1] call TMN_handle_number;
  742. _prat = rank player;
  743. if ((B_defensebudget< M2A1) OR (_prat != B_Maxrank)) then {hint format ["You do not have sufficient rank (Min Rank %1) or money (Costs $%2) to do this.", B_maxrank, form_M2A1]}
  744. else
  745. {_MATV= "B_MBT_01_cannon_F" createVehicle (getMarkerPos "vehspawn");
  746. B_defensebudget= (B_defensebudget-M2A1);
  747. publicVariable "B_defensebudget";
  748. B_totalcost= (B_totalcost+M2A1);
  749. publicVariable "B_totalcost";
  750. hint format ["You have purchased an M2A1 Slammer for $%1", form_M2A1];
  751. [] call doBudget; [] call DoTotal;
  752. };
  753. };
  754.  
  755.  
  756. case 1: {
  757. form_Sandstorm= [Sandstorm] call TMN_handle_number;
  758. _prat = rank player;
  759. if ((B_defensebudget< Sandstorm) OR (_prat != B_Maxrank)) then {hint format ["You do not have sufficient rank (Min Rank %1) or money (Costs $%2) to do this.", B_maxrank, form_Sandstorm]}
  760. else
  761. {_MATV= "B_MBT_01_mlrs_F" createVehicle (getMarkerPos "vehspawn");
  762. B_defensebudget= (B_defensebudget-Sandstorm);
  763. publicVariable "B_defensebudget";
  764. B_totalcost= (B_totalcost+Sandstorm);
  765. publicVariable "B_totalcost";
  766. hint format ["You have purchased an M5 Sandstorm MLRS for $%1", form_Sandstorm];
  767. [] call doBudget; [] call DoTotal;
  768.  
  769. };
  770. };
  771.  
  772. case 2: {
  773. form_AMV7= [AMV7] call TMN_handle_number;
  774. _prat = rank player;
  775. if ((B_defensebudget< AMV7) OR (_prat != B_Maxrank)) then {hint format ["You do not have sufficient rank (Min Rank %1) or money (Costs $%2) to do this.", B_maxrank, form_AMV7]}
  776. else
  777. {_MATV= "B_APC_Wheeled_01_cannon_F" createVehicle (getMarkerPos "vehspawn");
  778. B_defensebudget= (B_defensebudget-AMV7);
  779. publicVariable "B_defensebudget";
  780. B_totalcost= (B_totalcost+AMV7);
  781. publicVariable "B_totalcost";
  782. hint format ["You have purchased an AMV 7 for $%1", form_AMV7];
  783. [] call doBudget; [] call DoTotal;
  784. };
  785. };
  786.  
  787.  
  788. case 3: {
  789. form_IFV6c= [IFV6c] call TMN_handle_number;
  790. _prat = rank player;
  791. if ((B_defensebudget< IFV6c) OR (_prat != B_Maxrank)) then {hint format ["You do not have sufficient rank (Min Rank %1) or money (Costs $%2) to do this.", B_maxrank, form_IFV6c]}
  792. else
  793. {_MATV= "B_APC_Tracked_01_rcws_F" createVehicle (getMarkerPos "vehspawn");
  794. B_defensebudget= (B_defensebudget-IFV6c);
  795. publicVariable "B_defensebudget";
  796. B_totalcost= (B_totalcost+IFV6c);
  797. publicVariable "B_totalcost";
  798. hint format ["You have purchased an IFV-6C Panther APC for $%1", form_IFV6c];
  799. [] call doBudget; [] call DoTotal;
  800. };
  801. };
  802.  
  803. case 4: {
  804. form_IFV6a= [IFV6a] call TMN_handle_number;
  805. _prat = rank player;
  806. if ((B_defensebudget< IFV6a) OR (_prat != B_Maxrank)) then {hint format ["You do not have sufficient rank (Min Rank %1) or money (Costs $%2) to do this.", B_maxrank, form_IFV6a]}
  807. else
  808. {_MATV= "B_APC_Tracked_01_AA_F" createVehicle (getMarkerPos "vehspawn");
  809. B_defensebudget= (B_defensebudget-IFV6a);
  810. publicVariable "B_defensebudget";
  811. B_totalcost= (B_totalcost+IFV6a);
  812. publicVariable "B_totalcost";
  813. hint format ["You have purchased an IFV-6C Cheetah Anti Air Tank for $%1", form_IFV6a];
  814. [] call doBudget; [] call DoTotal;
  815. };
  816. };
  817.  
  818. default { hint "Something went wrong...Couldn't find case for selection!" };
  819. // End of Armor Block
  820. };
  821. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement