Advertisement
Guest User

Untitled

a guest
Mar 27th, 2015
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.66 KB | None | 0 0
  1. private ["_inCombat","_positionM","_Marker","_LastUsedTime","_height","_downspeed""_distance","_boxtype","_unit","_getPos","_position","_box","_chute","_smoke","_var","_textt","_tools","_items","_getPos2","_positionB","_supplies","_weapon","_weapon2","_weapon3","_weapon4","_weapon5","_weapon6","_giveWep","_possibleMags","_mag","_whichBuild","_crateItems","_text"];
  2.  
  3. //_cost = 2000;
  4. //_wealth = player getVariable["cashMoney",0];
  5. _distance = 500;
  6. _boxtype = "USVehicleBox_EP1";
  7. _LastUsedTime = 10;
  8. _height = 100;
  9. _downspeed = -3;
  10. _OnlineLimit = 1;
  11. _unit = player;
  12. _getPos = getPos _unit;
  13. _position = [_getPos select 0, (_getPos select 1) - 5, _height];
  14. _positionM = [_getPos select 0, _getPos select 1];
  15. _inCombat = player getVariable["combattimeout", 0];
  16. systemchat format["got all variables"];
  17. //System Chat Message
  18. _playerName = name player;
  19. //System Chat Message
  20.  
  21. //item lists
  22. _tools = ["ItemEtool","ItemKnife","ItemGPS"];
  23. _items = ["ItemSodaPepsi","FoodCanSardines"];
  24. //_walls = ["ItemWoodWallGarageDoor","ItemWoodWallWithDoorLg","ItemWoodWallLg","ItemWoodWallGarageDoor","ItemWoodFloor","metal_floor_kit"];
  25. _supplies = ["ItemTankTrap","PartGlass"];
  26. systemchat format["set some variables"];
  27. /*
  28. _giveWep = ["FHQ_ACR_WDL_TWS_SD","BAF_LRR_scoped","USSR_cheytacM200_sd"] call BIS_fnc_selectRandom;
  29. _possibleMags = getArray (configfile >> "cfgWeapons" >> _giveWep >> "magazines");
  30. _mag = _possibleMags select 0;systemchat format["Objects now: %1",_Count];
  31. */
  32.  
  33. systemchat format["right befor calling it"];
  34. //select arrays to use
  35. _crateItems = [_supplies,_items] call BIS_fnc_selectRandom;
  36. _Time = time - lastpack;
  37.  
  38. if(_Time < _LastUsedTime) exitWith { // If cooldown is not done then exit script
  39. cutText [format["please wait %1 before calling in another Air Drop!",(round(_Time - _LastUsedTime))], "PLAIN DOWN"]; //display text at bottom center of screen when players cooldown is not done
  40. };
  41. systemchat format["_inCombat: %1",(_inCombat >= time)];
  42. //if(!(canbuild) || (inSafeZone)) exitWith { cutText ["\n\nYou are in a Safezone and cannot perform that action!" , "PLAIN DOWN"]; };
  43. if (player getVariable["combattimeout", 0] >= time) exitwith { cutText ["\n\nYou are in combat and cannot perform that action!", "PLAIN DOWN"] };
  44.  
  45.  
  46. if ((count playableUnits) < _OnlineLimit) exitWith { cutText [format["Air Drop Failed. Less Than %1 Players online.",_OnlineLimit], "PLAIN DOWN"]; };
  47. /*if(_wealth < _cost) exitWith { cutText [format["You need %1 coins to Call an AirDrop.",_cost], "PLAIN DOWN"]; };
  48.  
  49. player setVariable["cashMoney",(_wealth - _cost),true];
  50.  
  51. PVDZE_plr_Save = [player,(magazines player),true,true] ;
  52. publicVariableServer "PVDZE_plr_Save";*/
  53. systemchat format["setmarker"];
  54. deleteMarker "MarkerDrop";
  55. _null = createMarker ["MarkerDrop",_positionM];
  56. "MarkerDrop" setMarkerText "Air Drop";
  57. "MarkerDrop" setMarkerType "Vehicle";
  58. "MarkerDrop" setMarkerColor "ColorRed";
  59.  
  60.  
  61. systemchat format["after marker"];
  62. //System Chat Message
  63. _message = format["%1 has called in an AirDrop. It will arrive in 100 seconds! It is marked on your map, Go Capture it!",_playerName];
  64. [nil,nil,rTitleText,_message, "PLAIN",6] call RE;
  65. diag_log text format["[AirDrop]: Air Drop Called By a Player Successfully"];
  66. //System Chat Message
  67. systemchat format["announced: %1",_message];
  68.  
  69. lastpack = time;
  70.  
  71. for "_x" from 1 to 10 do {
  72. if (_x >= 2) then {cutText [format ["AIR DROP ARRIVING IN %1", 101-_x], "PLAIN DOWN"];};
  73. uiSleep 1;
  74. };
  75. systemchat format["time till airdrop announced"];
  76. _chute = createVehicle ["ParachuteMediumEast", _position, [], 0, "FLY"];
  77. _chutePos = getPos _chute;
  78. _box = createVehicle [_boxtype, _chutePos, [], 0, "FLY"];
  79. _box attachTo [_chute, [0,0,3]];
  80. _box setVariable ["Mission",1,true];
  81. _chute setVariable ["Mission",1,true];
  82. _box setVariable ["ObjectID", ""];
  83. _chute setVariable ["ObjectID", ""];
  84. _smoke = "SmokeShellBlue" createVehicle (getPos _box);
  85. _smoke attachTo [_box, [0,0,0]];
  86. _var = floor((random 20) + 1);
  87.  
  88.  
  89. systemchat format["crate spawned: %1",_boxtype];
  90. //display text to alert user
  91. _textt = format ["\nCarepackage is above you!",10];
  92. titleText [_textt,"PLAIN DOWN"];
  93.  
  94.  
  95. waitUntil {getPos _box select 2 < 4};
  96. /*
  97. while {getPos _box select 2 > 4} do
  98. {
  99. _chute SetVelocity [0,0,_downspeed];
  100. uiSleep 0.1;
  101. };
  102. */
  103.  
  104.  
  105. detach _box;
  106. while {getPos _box select 2 > 0} do {
  107. _box setPos [getPos _box select 0, getPos _box select 1, (getPos _box select 2) - .25]
  108. };
  109. deleteVehicle _chute;
  110. _posATL = getPosATL _box;
  111. deleteVehicle _box;
  112. _boxx = _boxtype createVehicle _posATL;
  113. _boxx setVariable ["Mission",1,true];
  114. _boxx setVariable ["ObjectID", ""];
  115. systemchat format["crate dropped"];
  116. clearweaponcargoglobal _boxx;
  117. clearmagazinecargoglobal _boxx;
  118. /*
  119. {_boxx addMagazineCargoGlobal [_x, _var];} forEach _crateItems;
  120. {_boxx addWeaponCargoGlobal [_x, 5];} forEach _tools;
  121. _boxx addMagazineCargoGlobal [_mag, _var];
  122. _boxx addWeaponCargoGlobal [_giveWep, 5];
  123. */
  124.  
  125. for "_i" from 0 to 9 do {
  126. _giveWep = ["FHQ_ACR_WDL_TWS_SD","BAF_LRR_scoped","USSR_cheytacM200_sd","FHQ_ACR_BLK_RCO_GL","BAF_LRR_scoped_W","USSR_cheytacM200"] call BIS_fnc_selectRandom;
  127. _possibleMags = getArray (configfile >> "cfgWeapons" >> _giveWep >> "magazines");
  128. _mag = _possibleMags select 0;
  129. _boxx addMagazineCargoGlobal [_mag, _var];
  130. _boxx addWeaponCargoGlobal [_giveWep, 1];
  131. };
  132.  
  133. {_boxx addMagazineCargoGlobal [_x, _var];} forEach _crateItems;
  134. {_boxx addWeaponCargoGlobal [_x, 1];} forEach _tools;
  135.  
  136.  
  137. systemchat format["crate add loot"];
  138.  
  139.  
  140. _getPos2 = getPos _boxx;
  141. _positionB = [_getPos2 select 0, _getPos2 select 1];
  142.  
  143. deleteMarker "MarkerDrop";
  144. _null = createMarker ["MarkerDrop",_positionB];
  145. "MarkerDrop" setMarkerText "Air Drop";
  146. "MarkerDrop" setMarkerType "Defend";
  147. "MarkerDrop" setMarkerColor "ColorRed";
  148.  
  149. _message3= format["The Carepackage has Landed! Check Your Map and Race to Claim it!",_playerName];
  150. [nil,nil,rTitleText,_message3, "PLAIN",6] call RE;
  151. diag_log text format["[AirDrop]: Air Drop Landed Successfully"];
  152. systemchat format["crate dropped"];
  153.  
  154. //Wait until player is near, wait 90 seconds and delete marker/box.
  155. waitUntil{
  156. sleep 1;
  157. (({isPlayer _x && _x distance _boxx <= 5} count playableUnits > 0));
  158. };
  159.  
  160.  
  161. _message2 = format["A player is at the carepackage! It will despawn in 90 seconds!",_playerName];
  162. [nil,nil,rTitleText,_message2, "PLAIN",6] call RE;
  163. diag_log text format["[AirDrop]: Air Drop Landed Successfully"];
  164. systemchat format["player arrived"];
  165.  
  166. sleep 10;
  167. deleteMarker "MarkerDrop";
  168. deleteVehicle _boxx;
  169.  
  170.  
  171. _message = format["The Air Drop has been Captured",_playerName];
  172. [nil,nil,rTitleText,_message, "PLAIN",6] call RE;
  173. diag_log text format["[AirDrop]: Air Drop captured Successfully. Deleting Marker"];
  174. systemchat format["ende"];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement