Advertisement
Guest User

Untitled

a guest
Mar 29th, 2015
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.16 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.  
  55. //Schwedes Marker Script
  56.  
  57. _markername = "MarkerDrop";
  58. _getPos = _positionM;
  59. _text = "Air Drop";
  60. _type = "Vehicle"; //Possible Values: "ICON", "RECTANGLE", "ELLIPSE" << or >> https://community.bistudio.com/wiki/cfgMarkers
  61. _sizeX = 0; //Needs to be a Number || Use 0 if NOT using "ICON", "RECTANGLE", "ELLIPSE"
  62. _sizeY = 0; //Needs to be a Nubmer || Use 0 if NOT using "ICON", "RECTANGLE", "ELLIPSE"
  63. _color = "ColorRed"; //Possible Values: "Default", "ColorBlack", "ColorGrey", "ColorRed", "ColorGreen", "ColorBlue", "ColorYellow", "ColorOrange", "ColorWhite", "ColorPink", "ColorBrown", "ColorKhaki", "ColorWEST", "ColorEAST", "ColorGUER", "ColorCIV", "ColorUNKNOWN", "Color1_FD_F" (Light red), "Color2_FD_F" (Light khaki), "Color3_FD_F" (Light orange), "Color4_FD_F" (Light blue)
  64.  
  65.  
  66. PVDZE_SchwedesMarker = [_markername,_getPos,_text,_type,_sizeX,_sizeY,_color];
  67. publicVariableServer "PVDZE_SchwedesMarker";
  68.  
  69.  
  70. systemchat format["after marker"];
  71. //System Chat Message
  72. _message = format["%1 has called in an AirDrop. It will arrive in 100 seconds! It is marked on your map, Go Capture it!",_playerName];
  73. [nil,nil,rTitleText,_message, "PLAIN",6] call RE;
  74. diag_log text format["[AirDrop]: Air Drop Called By a Player Successfully"];
  75. //System Chat Message
  76. systemchat format["announced: %1",_message];
  77.  
  78. lastpack = time;
  79.  
  80. for "_x" from 1 to 10 do {
  81. if (_x >= 2) then {cutText [format ["AIR DROP ARRIVING IN %1", 101-_x], "PLAIN DOWN"];};
  82. uiSleep 1;
  83. };
  84. systemchat format["time till airdrop announced"];
  85. _chute = createVehicle ["ParachuteMediumEast", _position, [], 0, "FLY"];
  86. _chutePos = getPos _chute;
  87. _box = createVehicle [_boxtype, _chutePos, [], 0, "FLY"];
  88. _box attachTo [_chute, [0,0,3]];
  89. _box setVariable ["Mission",1,true];
  90. _chute setVariable ["Mission",1,true];
  91. _box setVariable ["ObjectID", ""];
  92. _chute setVariable ["ObjectID", ""];
  93. _smoke = "SmokeShellBlue" createVehicle (getPos _box);
  94. _smoke attachTo [_box, [0,0,0]];
  95. _var = floor((random 20) + 1);
  96.  
  97.  
  98. systemchat format["crate spawned: %1",_boxtype];
  99. //display text to alert user
  100. _textt = format ["\nCarepackage is above you!",10];
  101. titleText [_textt,"PLAIN DOWN"];
  102.  
  103.  
  104. waitUntil {getPos _box select 2 < 4};
  105. /*
  106. while {getPos _box select 2 > 4} do
  107. {
  108. _chute SetVelocity [0,0,_downspeed];
  109. uiSleep 0.1;
  110. };
  111. */
  112.  
  113.  
  114. detach _box;
  115. while {getPos _box select 2 > 0} do {
  116. _box setPos [getPos _box select 0, getPos _box select 1, (getPos _box select 2) - .25]
  117. };
  118. deleteVehicle _chute;
  119. _posATL = getPosATL _box;
  120. deleteVehicle _box;
  121. _boxx = _boxtype createVehicle _posATL;
  122. _boxx setVariable ["Mission",1,true];
  123. _boxx setVariable ["ObjectID", ""];
  124. systemchat format["crate dropped"];
  125. clearweaponcargoglobal _boxx;
  126. clearmagazinecargoglobal _boxx;
  127. /*
  128. {_boxx addMagazineCargoGlobal [_x, _var];} forEach _crateItems;
  129. {_boxx addWeaponCargoGlobal [_x, 5];} forEach _tools;
  130. _boxx addMagazineCargoGlobal [_mag, _var];
  131. _boxx addWeaponCargoGlobal [_giveWep, 5];
  132. */
  133.  
  134. for "_i" from 0 to 9 do {
  135. _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;
  136. _possibleMags = getArray (configfile >> "cfgWeapons" >> _giveWep >> "magazines");
  137. _mag = _possibleMags select 0;
  138. _boxx addMagazineCargoGlobal [_mag, _var];
  139. _boxx addWeaponCargoGlobal [_giveWep, 1];
  140. };
  141.  
  142. {_boxx addMagazineCargoGlobal [_x, _var];} forEach _crateItems;
  143. {_boxx addWeaponCargoGlobal [_x, 1];} forEach _tools;
  144.  
  145.  
  146. systemchat format["crate add loot"];
  147.  
  148.  
  149. _getPos2 = getPos _boxx;
  150. _positionB = [_getPos2 select 0, _getPos2 select 1];
  151.  
  152. //Schwedes Marker Script
  153.  
  154. _markername = "MarkerDrop";
  155. _getPos = _positionB;
  156. _text = "Air Drop";
  157. _type = "Defend"; //Possible Values: "ICON", "RECTANGLE", "ELLIPSE" << or >> https://community.bistudio.com/wiki/cfgMarkers
  158. _sizeX = 0; //Needs to be a Number || Use 0 if NOT using "ICON", "RECTANGLE", "ELLIPSE"
  159. _sizeY = 0; //Needs to be a Nubmer || Use 0 if NOT using "ICON", "RECTANGLE", "ELLIPSE"
  160. _color = "ColorRed"; //Possible Values: "Default", "ColorBlack", "ColorGrey", "ColorRed", "ColorGreen", "ColorBlue", "ColorYellow", "ColorOrange", "ColorWhite", "ColorPink", "ColorBrown", "ColorKhaki", "ColorWEST", "ColorEAST", "ColorGUER", "ColorCIV", "ColorUNKNOWN", "Color1_FD_F" (Light red), "Color2_FD_F" (Light khaki), "Color3_FD_F" (Light orange), "Color4_FD_F" (Light blue)
  161.  
  162.  
  163. PVDZE_SchwedesMarker = [_markername,_getPos,_text,_type,_sizeX,_sizeY,_color];
  164. publicVariableServer "PVDZE_SchwedesMarker";
  165.  
  166.  
  167. _message3= format["The Carepackage has Landed! Check Your Map and Race to Claim it!",_playerName];
  168. [nil,nil,rTitleText,_message3, "PLAIN",6] call RE;
  169. diag_log text format["[AirDrop]: Air Drop Landed Successfully"];
  170. systemchat format["crate dropped"];
  171.  
  172. //Wait until player is near, wait 90 seconds and delete marker/box.
  173. waitUntil{
  174. sleep 1;
  175. (({isPlayer _x && _x distance _boxx <= 5} count playableUnits > 0));
  176. };
  177.  
  178.  
  179. _message2 = format["A player is at the carepackage! It will despawn in 90 seconds!",_playerName];
  180. [nil,nil,rTitleText,_message2, "PLAIN",6] call RE;
  181. diag_log text format["[AirDrop]: Air Drop Landed Successfully"];
  182. systemchat format["player arrived"];
  183.  
  184. sleep 10;
  185. PVDZE_SchwedesMarkerRemove = [_markername];
  186. publicVariableServer "PVDZE_SchwedesMarkerRemove";
  187. deleteVehicle _boxx;
  188.  
  189.  
  190. _message = format["The Air Drop has been Captured",_playerName];
  191. [nil,nil,rTitleText,_message, "PLAIN",6] call RE;
  192. diag_log text format["[AirDrop]: Air Drop captured Successfully. Deleting Marker"];
  193. systemchat format["ende"];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement