wardenAmmoBox.sqf 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. //Warden Ammo Box Created by Namenai - Updated by Rexi 21/04/2018
  2. Warden=
  3. {
  4. params["_obj"];
  5. [_obj,[0,"optre_vehicles\longsword\data\LS_bay2_co.paa"]] remoteExec ["setObjectTexture",-2];
  6. _obj addAction ["<t color='#00FF00'>Become Aviation Warden</t>", {
  7. params["_this","_user"];
  8. //LAAT
  9. _user addAction ["<t color='#0000FF'>Resupply Low Altitude Assault Transport</t>",
  10. {
  11. [] execVM (resupplyBoxQuick+resupplyLaat);
  12. },[1],0,false,true,"","_target == _this"];
  13. //ARC 170 - Resupply ARC 170
  14. _user addAction ["<t color='#0000FF'>Resupply ARC 170 Multi Role Fighter</t>",
  15. {
  16. [] execVM (resupplyBoxQuick+resupplyArc170);
  17. },[1],0,false,true,"","_target == _this"];
  18. //V-WING --- Add Ammo Action for V-WING
  19. _user addAction ["<t color='#0000FF'>Resupply V-Wing Interceptor>",
  20. {
  21. [] execVM (resupplyBoxQuick+resupplyVwing);
  22. },[1],0,false,true,"","_target == _this"];
  23. //Y-WING --- Add Ammo Action for Y-WING
  24. _user addAction ["<t color='#0000FF'>Resupply Y-Wing Bomber>",
  25. {
  26. [] execVM (resupplyBoxQuick+resupplyYwing);
  27. },[1],0,false,true,"","_target == _this"];
  28. //Fuel --- Add Fuel
  29. _user addAction ["<t color='#0320FF'>Resupply Fuel</t>",
  30. {
  31. if (player distance cursorTarget < 5) then
  32. {
  33. player playMove "AinvPknlMstpsnonWnonDnon_medic_1";
  34. sleep 3;
  35. player playMove "AinvPknlMstpsnonWnonDnon_medic_1";
  36. sleep 3;
  37. player playActionNow "stop";
  38. player playMove "AinvPknlMstpsnonWnonDnon_medic_1";
  39. sleep 3;
  40. cursorTarget setfuel 1;
  41. hintSilent "Refuelled vehicle";
  42. };
  43. },[1],0,false,true,"","_target == _this"];
  44. [_user,format["%1 Has become a warden at time %2 (Unlimited resupplies for user)",(name _user),time]] remoteExec ["sideChat", 0];
  45. _user addAction ["<t color='#0000FF'>Resupply Generic Vehicle</t>",
  46. {
  47. if (player distance cursorTarget < 5) then
  48. {
  49. player playMove "AinvPknlMstpsnonWnonDnon_medic_1";
  50. sleep 3;
  51. player playMove "AinvPknlMstpsnonWnonDnon_medic_1";
  52. sleep 3;
  53. player playActionNow "stop";
  54. player playMove "AinvPknlMstpsnonWnonDnon_medic_1";
  55. sleep 3;
  56. cursortarget setVehicleAmmo 1;
  57. hintSilent "Rearmed vehicle";
  58. };
  59. },[1],0,false,true,"","_target == _this"];
  60. //Repair
  61. _user addAction ["<t color='#0000FF'>Do a field repair on vehicle</t>",
  62. {
  63. _truck=cursortarget;
  64. if (vehicle player == player) then
  65. {
  66. if (player distance _truck < 8) then
  67. {
  68. if ("ToolKit" in items player) then
  69. {
  70. if(animationState player != "AinvPknlMstpsnonWnonDnon_medic_1" ) then
  71. {
  72. player playMove "AinvPknlMstpsnonWnonDnon_medic_1";
  73. sleep 3;
  74. player playActionNow "stop";
  75. player playMove "AinvPknlMstpsnonWnonDnon_medic_1";
  76. sleep 3;
  77. player playActionNow "stop";
  78. player playMove "AinvPknlMstpsnonWnonDnon_medic_1";
  79. sleep 3;
  80. player playActionNow "stop";
  81. player playMove "AinvPknlMstpsnonWnonDnon_medic_1";
  82. sleep 3;
  83. player playMove "AinvPknlMstpsnonWnonDnon_medic_1";
  84. sleep 3;
  85. player playActionNow "stop";
  86. player playMove "AinvPknlMstpsnonWnonDnon_medic_1";
  87. sleep 3;
  88. player playMove "AinvPknlMstpsnonWnonDnon_medic_1";
  89. sleep 3;
  90. player playActionNow "stop";
  91. player playMove "AinvPknlMstpsnonWnonDnon_medic_1";
  92. sleep 3;
  93. };
  94. sleep 3;
  95. player removeItem "ToolKit";
  96. _truck setdammage 0.15;
  97. hintSilent "Repaired vehicle";
  98. }
  99. else
  100. {
  101. hintSilent "You need a toolkit to repair this vehicle!";
  102. };
  103. };
  104. };
  105. },[1],0,false,true,"","_target == _this"];
  106. },[1],0,false,true,""," driver _target == _this "];
  107. };
  108. ["OPTRE_cart", "init",Warden, true, [], true] call CBA_fnc_addClassEventHandler;