Advertisement
Guest User

mortar.sqf

a guest
Oct 20th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1.  
  2. private ["_done","_LastUsedTime","_Time"];
  3.  
  4. _done = false;
  5. _LastUsedTime = 3600;
  6. _Time = time - lastpack;
  7. _cost = 50000;
  8.  
  9.  
  10.  
  11.  
  12. ////////////////FUNCTION
  13. strike = {
  14. _pos = [_this select 0, _this select 1, 100];
  15.  
  16.  
  17. player setVariable[Z_moneyVariable, (_coins - _cost), true];
  18. titleText [format["you pay %1 coins",_cost] , "PLAIN DOWN", 1];
  19.  
  20.  
  21.  
  22. TitleText [format["Alpha-Tango 0900"], "PLAIN DOWN"]; titleFadeOut 3;
  23. sleep 1;
  24. createVehicle ["SH_125_HE", _pos,[], 0, "NONE"];
  25. openMap [false, false];
  26. TitleText [format[""], "PLAIN DOWN"];
  27. _done = true;
  28. lastpack = time;
  29. };
  30. /////////////////////
  31.  
  32.  
  33.  
  34. closedialog 0;
  35.  
  36. sleep 0.5;
  37.  
  38.  
  39.  
  40.  
  41.  
  42. if(_Time < _LastUsedTime) exitWith { // If cooldown is not done then exit script
  43. cutText [format["Mortar strike was launched %1 wait before try again!",(round(_Time - _LastUsedTime))], "PLAIN DOWN"]; //display text at bottom center of screen when players cooldown is not done
  44. };
  45.  
  46.  
  47.  
  48. _coins = player getVariable [Z_moneyVariable,0];
  49. if (_coins < _cost) exitWith {
  50. cutText[format["You need %1 coins to call the strike",_cost], "PLAIN DOWN"];
  51. dayz_actionInProgress = false;
  52. };
  53.  
  54.  
  55.  
  56.  
  57. TitleText [format["Click on the map to strike"], "PLAIN DOWN"]; titleFadeOut 3;
  58.  
  59. if(!(visibleMap)) then {
  60.  
  61. openMap [true, false];
  62.  
  63. };
  64.  
  65. onMapSingleClick '[_pos select 0, _pos select 1, _pos select 2] call strike';
  66.  
  67.  
  68.  
  69. waitUntil{_done};
  70.  
  71. onMapSingleClick "";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement