Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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"];
- //_cost = 2000;
- //_wealth = player getVariable["cashMoney",0];
- _distance = 500;
- _boxtype = "USVehicleBox_EP1";
- _LastUsedTime = 10;
- _height = 100;
- _downspeed = -3;
- _OnlineLimit = 1;
- _unit = player;
- _getPos = getPos _unit;
- _position = [_getPos select 0, (_getPos select 1) - 5, _height];
- _positionM = [_getPos select 0, _getPos select 1];
- _inCombat = player getVariable["combattimeout", 0];
- systemchat format["got all variables"];
- //System Chat Message
- _playerName = name player;
- //System Chat Message
- //item lists
- _tools = ["ItemEtool","ItemKnife","ItemGPS"];
- _items = ["ItemSodaPepsi","FoodCanSardines"];
- //_walls = ["ItemWoodWallGarageDoor","ItemWoodWallWithDoorLg","ItemWoodWallLg","ItemWoodWallGarageDoor","ItemWoodFloor","metal_floor_kit"];
- _supplies = ["ItemTankTrap","PartGlass"];
- systemchat format["set some variables"];
- /*
- _giveWep = ["FHQ_ACR_WDL_TWS_SD","BAF_LRR_scoped","USSR_cheytacM200_sd"] call BIS_fnc_selectRandom;
- _possibleMags = getArray (configfile >> "cfgWeapons" >> _giveWep >> "magazines");
- _mag = _possibleMags select 0;systemchat format["Objects now: %1",_Count];
- */
- systemchat format["right befor calling it"];
- //select arrays to use
- _crateItems = [_supplies,_items] call BIS_fnc_selectRandom;
- _Time = time - lastpack;
- if(_Time < _LastUsedTime) exitWith { // If cooldown is not done then exit script
- 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
- };
- systemchat format["_inCombat: %1",(_inCombat >= time)];
- //if(!(canbuild) || (inSafeZone)) exitWith { cutText ["\n\nYou are in a Safezone and cannot perform that action!" , "PLAIN DOWN"]; };
- if (player getVariable["combattimeout", 0] >= time) exitwith { cutText ["\n\nYou are in combat and cannot perform that action!", "PLAIN DOWN"] };
- if ((count playableUnits) < _OnlineLimit) exitWith { cutText [format["Air Drop Failed. Less Than %1 Players online.",_OnlineLimit], "PLAIN DOWN"]; };
- /*if(_wealth < _cost) exitWith { cutText [format["You need %1 coins to Call an AirDrop.",_cost], "PLAIN DOWN"]; };
- player setVariable["cashMoney",(_wealth - _cost),true];
- PVDZE_plr_Save = [player,(magazines player),true,true] ;
- publicVariableServer "PVDZE_plr_Save";*/
- systemchat format["setmarker"];
- deleteMarker "MarkerDrop";
- _null = createMarker ["MarkerDrop",_positionM];
- "MarkerDrop" setMarkerText "Air Drop";
- "MarkerDrop" setMarkerType "Vehicle";
- "MarkerDrop" setMarkerColor "ColorRed";
- systemchat format["after marker"];
- //System Chat Message
- _message = format["%1 has called in an AirDrop. It will arrive in 100 seconds! It is marked on your map, Go Capture it!",_playerName];
- [nil,nil,rTitleText,_message, "PLAIN",6] call RE;
- diag_log text format["[AirDrop]: Air Drop Called By a Player Successfully"];
- //System Chat Message
- systemchat format["announced: %1",_message];
- lastpack = time;
- for "_x" from 1 to 10 do {
- if (_x >= 2) then {cutText [format ["AIR DROP ARRIVING IN %1", 101-_x], "PLAIN DOWN"];};
- uiSleep 1;
- };
- systemchat format["time till airdrop announced"];
- _chute = createVehicle ["ParachuteMediumEast", _position, [], 0, "FLY"];
- _chutePos = getPos _chute;
- _box = createVehicle [_boxtype, _chutePos, [], 0, "FLY"];
- _box attachTo [_chute, [0,0,3]];
- _box setVariable ["Mission",1,true];
- _chute setVariable ["Mission",1,true];
- _box setVariable ["ObjectID", ""];
- _chute setVariable ["ObjectID", ""];
- _smoke = "SmokeShellBlue" createVehicle (getPos _box);
- _smoke attachTo [_box, [0,0,0]];
- _var = floor((random 20) + 1);
- systemchat format["crate spawned: %1",_boxtype];
- //display text to alert user
- _textt = format ["\nCarepackage is above you!",10];
- titleText [_textt,"PLAIN DOWN"];
- waitUntil {getPos _box select 2 < 4};
- /*
- while {getPos _box select 2 > 4} do
- {
- _chute SetVelocity [0,0,_downspeed];
- uiSleep 0.1;
- };
- */
- detach _box;
- while {getPos _box select 2 > 0} do {
- _box setPos [getPos _box select 0, getPos _box select 1, (getPos _box select 2) - .25]
- };
- deleteVehicle _chute;
- _posATL = getPosATL _box;
- deleteVehicle _box;
- _boxx = _boxtype createVehicle _posATL;
- _boxx setVariable ["Mission",1,true];
- _boxx setVariable ["ObjectID", ""];
- systemchat format["crate dropped"];
- clearweaponcargoglobal _boxx;
- clearmagazinecargoglobal _boxx;
- /*
- {_boxx addMagazineCargoGlobal [_x, _var];} forEach _crateItems;
- {_boxx addWeaponCargoGlobal [_x, 5];} forEach _tools;
- _boxx addMagazineCargoGlobal [_mag, _var];
- _boxx addWeaponCargoGlobal [_giveWep, 5];
- */
- for "_i" from 0 to 9 do {
- _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;
- _possibleMags = getArray (configfile >> "cfgWeapons" >> _giveWep >> "magazines");
- _mag = _possibleMags select 0;
- _boxx addMagazineCargoGlobal [_mag, _var];
- _boxx addWeaponCargoGlobal [_giveWep, 1];
- };
- {_boxx addMagazineCargoGlobal [_x, _var];} forEach _crateItems;
- {_boxx addWeaponCargoGlobal [_x, 1];} forEach _tools;
- systemchat format["crate add loot"];
- _getPos2 = getPos _boxx;
- _positionB = [_getPos2 select 0, _getPos2 select 1];
- deleteMarker "MarkerDrop";
- _null = createMarker ["MarkerDrop",_positionB];
- "MarkerDrop" setMarkerText "Air Drop";
- "MarkerDrop" setMarkerType "Defend";
- "MarkerDrop" setMarkerColor "ColorRed";
- _message3= format["The Carepackage has Landed! Check Your Map and Race to Claim it!",_playerName];
- [nil,nil,rTitleText,_message3, "PLAIN",6] call RE;
- diag_log text format["[AirDrop]: Air Drop Landed Successfully"];
- systemchat format["crate dropped"];
- //Wait until player is near, wait 90 seconds and delete marker/box.
- waitUntil{
- sleep 1;
- (({isPlayer _x && _x distance _boxx <= 5} count playableUnits > 0));
- };
- _message2 = format["A player is at the carepackage! It will despawn in 90 seconds!",_playerName];
- [nil,nil,rTitleText,_message2, "PLAIN",6] call RE;
- diag_log text format["[AirDrop]: Air Drop Landed Successfully"];
- systemchat format["player arrived"];
- sleep 10;
- deleteMarker "MarkerDrop";
- deleteVehicle _boxx;
- _message = format["The Air Drop has been Captured",_playerName];
- [nil,nil,rTitleText,_message, "PLAIN",6] call RE;
- diag_log text format["[AirDrop]: Air Drop captured Successfully. Deleting Marker"];
- systemchat format["ende"];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement