vicSpawner.sqf 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. pads=[
  2. [pad_middle,1],
  3. [pad_left,1],
  4. [pad_right,1]
  5. ];
  6. vics=[
  7. ["swop_LAAT","<t color='#00FF00'> Laat MK1</t>"],
  8. ["swop_LAATmk2","<t color='#00FF00'> Laat MK2</t>"],
  9. ["swop_LAATmk2_74","<t color='#F4A460 '> Laat MK2 74th</t>"],
  10. ["swop_LAATmk2_104","<t color='#0000FF'> Laat MK2 104th</t>"],
  11. ["swop_LAATmk2_spec","<t color='#FF0000'> Laat MK2 Spec Op</t>"],
  12. ["swop_LAATmk2_ARC","<t color='#00f9ff'> Laat MK2 ARC</t>"],
  13. ["swop_LAAT_cargo","<t color='#0000FF'> Laat Cargo</t>"],
  14. ["swop_arc_t","<t color='#FF0000'> ARC-170</t>"],
  15. ["swop_ywclones","<t color='#FFFF00'> Y-Wing</t>"]
  16. ];
  17. _this setVariable ["vicToSpawn",((vics select 0) select 0), false];
  18. _this setVariable ["padToSpawnOn",((pads select 0) select 0), false];
  19. _this setVariable ["heightOfPad",((pads select 0) select 1), false];
  20. for [{_i=0}, {_i<(count vics)}, {_i=_i+1}] do
  21. {
  22. titleOfAction=format["%1%2",_i, (vics select _i) select 1];
  23. _this addAction [titleOfAction,
  24. {
  25. itemNum=(_this select 2);
  26. (_this select 0) setVariable ["vicToSpawn",((vics select itemNum) select 0), false];
  27. itemNum="";
  28. }];
  29. };
  30. _this addAction ["<t color='#FF0000'>--------------------------------</t>",
  31. {
  32. hint "no-CC Bondo ^.^";
  33. }];
  34. for [{_i=0}, {_i<(count pads)}, {_i=_i+1}] do
  35. {
  36. titleOfAction=format["%1 %2",_i, (pads select _i) select 0];
  37. _this addAction [titleOfAction,
  38. {
  39. itemNum=(_this select 2)-(count vics)-1;
  40. (_this select 0) setVariable ["padToSpawnOn",((pads select itemNum) select 0), false];
  41. (_this select 0) setVariable ["heightOfPad",((pads select itemNum) select 1), false];
  42. itemNum="";
  43. }];
  44. };
  45. _this addAction ["<t color='#00FF00'>Spawn Vehicle</t>",
  46. {
  47. unitVic=(_this select 0) getVariable "vicToSpawn";
  48. unitPad=(_this select 0) getVariable "padToSpawnOn";
  49. unitPadHeight=(_this select 0) getVariable "heightOfPad";
  50. _unit=createVehicle [unitVic, [(getPos unitPad select 0), (getPos unitPad select 1), (getPos unitPad select 2)+unitPadHeight], [], 0,"CAN_COLLIDE"];
  51. _unit setDir (getDir unitPad);
  52. _unit="";
  53. unitVic="";
  54. unitPad="";
  55. unitPadHeight="";
  56. }];