Перейти к публикации

ZizionarD

Event Ивент на Air Drop

Рекомендованные сообщения



Скрытый текст

 

 

Установка:

1. Открываем init.sqf и находим строку:

EpochUseEvents = true; //Если у вас false, то ставим true

далее находим массив:

EpochEvents = [];

в начало или конец вставляем:

["any","any","any","any",10,"supply_from_air"]

2. Создаем файл supply_from_air.sqf и вставляем код:

Скрытый текст

private ["_finishEvent","_waypointsrange","_markerRadius","_followmarker","_loot_lists","_loot","_loot2","_loot4","_loot3","_loot5","_loot6","_loot7","_loot8","_weapon5","_weapon6",
"_giveWep","_giveWep2","_possibleMags","_mag","_crateItems","_var","_spawnChance","_spawnRadius","_spawnMarker","_position","_positionarray","_startingpos","_marker_on_radius","_follow_marker",
"_aiskin","_this","_center_1","_unitGroup","_pilot","_heli_class","_helicopter","_gunner","_gunner2","_xpos","_ypos","_waypos1","_waypos2","_waypos3","_waypos4","_wp1",
"_wp2","_wp3","_wp4","_waypointend","_despawn_timer","_missiontimeout","_cleanmission","_playerPresent","_starttime","_currenttime","_box","_chute","_smoke","_box2","_chute2","_smoke2",
"_boxtype","_getPos","_positiondrop","_positiondrop2","_positiondrop3","_positiondrop4","_box3","_box4","_chute3","_chute4","_smoke3","_smoke4","_objectslist00"];

//------------------------------------------------------------------------------------------------------------------------------------------------------------//
/////////////////////////////////////////////////CONFIGS/////////////////////////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------------------------------------------------------------------------------------------------//

_waypointsrange = 100;//range to move
_markerRadius = 250; //  spawn and used for the marker

//------------------------------------------------------------------------------------------------------------------------------------------------------------//
/////////////////////////////////////////////////CONFIGS/////////////////////////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------------------------------------------------------------------------------------------------//

//Loot for box 3/4

_loot_lists = [
[
["ChainSawR","ItemSledge","ItemPickaxe"],
["MortarBucket","MortarBucket","bulk_ItemSodaCokeFull","bulk_ItemWire","bulk_PartGeneric","PartPlywoodPack","PartPlankPack","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","PartGeneric"]
],
[
["ItemKeyKit"],
["ItemAntibiotic","ItemBandage","ItemAntibacterialWipe","ItemMorphine","ItemPainkiller","equip_string","equip_gauze","equip_gauzepackaged","equip_rag","equip_herb_box","ItemGoldBar10oz"]
],
[
["ItemHatchet","ItemMachete","ItemPickaxe","ItemSledge"],
["ItemRuby","ItemMixOil","plot_pole_kit","ItemGoldBar10oz","ItemGoldBar10oz","ItemGoldBar10oz","ItemGoldBar10oz","ItemGoldBar10oz","ItemGoldBar10oz","ItemGoldBar10oz"]
],
[
["ChainSaw"],
["ItemDesertTent","ItemGenerator","equip_brick","equip_duct_tape","equip_rope","equip_hose","equip_lever","equip_nails","equip_metal_sheet","equip_1inch_metal_pipe","equip_2inch_metal_pipe","ItemWire","ItemTankTrap","ItemCorrugated","ItemPole"]
],
[
["MP5_DZ"],
["ItemComboLock","ItemVault","ItemLockBox"]
],
[
["DMR_DZ"],
["ItemAntibiotic","ItemAntibacterialWipe","20Rnd_762x51_DMR","20Rnd_762x51_DMR","20Rnd_762x51_DMR"]
],
[
["m107_DZ"],
["10Rnd_127x99_m107","10Rnd_127x99_m107","50Rnd_127x107_DSHKM","MortarBucket","MortarBucket","MortarBucket","MortarBucket","MortarBucket","MortarBucket","transfusionKit","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks"]
],

[
["SVD_DZ"],
["PartWheel","PartWheel","PartWheel","PartGlass","PartGlass","PartGlass","PartEngine","PartEngine","PartVRotor","PartVRotor","PartFueltank","PartFueltank","ItemFuelcan","ItemFuelcan","ItemJerrycan","ItemJerrycan","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks"]
]
];
_loot = _loot_lists call BIS_fnc_selectRandom;
_loot2 = _loot_lists call BIS_fnc_selectRandom;
_loot3 = _loot_lists call BIS_fnc_selectRandom;
_loot4 = _loot_lists call BIS_fnc_selectRandom;
_loot5 = _loot_lists call BIS_fnc_selectRandom;
_loot6 = _loot_lists call BIS_fnc_selectRandom;
_loot7 = _loot_lists call BIS_fnc_selectRandom;
_loot8 = _loot_lists call BIS_fnc_selectRandom;

//------------------------------------------------------------------------------------------------------------------------------------------------------------//
/////////////////////////////////////////////////CONFIG THE EVENT SPAWN/////////////////////////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------------------------------------------------------------------------------------------------//

_spawnRadius = 5000;
_spawnMarker = 'center';
_position = [getMarkerPos "center",0,5500,10,0,2000,0] call BIS_fnc_findSafePos;
_positionarray = [
[(_position select 0) - 14.5, (_position select 1) - 21,-0.012],
[(_position select 0) - 20, (_position select 1) - 20,-0.012],
[(_position select 0) + 25, (_position select 1) + 5,-0.012],
[(_position select 0) + 16, (_position select 1) - 14,-0.012],
[(_position select 0) + 49, (_position select 1) + 17.5,-0.012],
[(_position select 0) + 38.5, (_position select 1) - 16,-0.012]
];
_startingpos = _positionarray call BIS_fnc_selectRandom;

//------------------------------------------------------------------------------------------------------------------------------------------------------------//
/////////////////////////////////////////////////END SPAWN CONFIG///////////////////////////////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------------------------------------------------------------------------------------------------//

if (isNil "EPOCH_EVENT_RUNNING") then {
EPOCH_EVENT_RUNNING = false;
};
 
// Check for another event running
if (EPOCH_EVENT_RUNNING) exitWith {
diag_log("Event already running");
};

EPOCH_EVENT_RUNNING = true;

//------------------------------------------------------------------------------------------------------------------------------------------------------------//
/////////////////////////////////////////////////CONFIG MARKERS/////////////////////////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------------------------------------------------------------------------------------------------//

_marker_on_radius = createMarker ["helirad",_position];
_marker_on_radius setMarkerShape "ELLIPSE";
_marker_on_radius setMarkerType "Cricle01";
_marker_on_radius setMarkerColor "ColorRed";
_marker_on_radius setMarkerAlpha 0.8;
_marker_on_radius setMarkerBrush "DiagGrid";
_marker_on_radius setMarkerSize [(_markerRadius + 50), (_markerRadius + 50)];

_follow_marker = createMarker ["marker-follow-heli",_startingpos]; 
_follow_marker setMarkerText "Helicopter";
_follow_marker setMarkerShape "ICON";
_follow_marker setMarkerType "mil_triangle";
_follow_marker setMarkerColor "ColorBlue";
_follow_marker setMarkerAlpha 1;
_follow_marker setMarkerSize [0.8,0.8];

//------------------------------------------------------------------------------------------------------------------------------------------------------------//
/////////////////////////////////////////////////////////////////SPAWNS/////////////////////////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------------------------------------------------------------------------------------------------//

//send global text for each player
[nil,nil,rTitleText,"Thers an Civil Defense Helicopter check your map to get supplys", "PLAIN",10] call RE;

_objectslist00 = createVehicle ["FlagCarrierRU", [(_startingpos select 0) + 1, (_startingpos select 1) - 1,-0.12],[], 0, "CAN_COLLIDE"];
_objectslist00 setDir 0;
_objectslist00 setVectorUp surfaceNormal position _objectslist00;

//------------------------------------------------------------------------------------------------------------------------------------------------------------//
/////////////////////////////////////////////////TIME/PLAYERS MONITOR/////////////////////////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------------------------------------------------------------------------------------------------//

_despawn_timer = 400;
_missiontimeout = true;
_cleanmission = false;
_playerPresent = false;
_starttime = floor(time);
while {_missiontimeout} do {

sleep 10;
_currenttime = floor(time);
{if((isPlayer _x) && (_x distance _startingpos <= 150)) then {_playerPresent = true};}forEach playableUnits;//check for nearest players
if (_currenttime - _starttime >= _despawn_timer) then {_cleanmission = true;};
if ((_playerPresent) || (_cleanmission)) then {_missiontimeout = false;};
};

if (_cleanmission) exitWith{
deleteMarker _follow_marker;
deleteMarker _marker_on_radius;
deleteVehicle _objectslist00;
[nil,nil,rTitleText,"Helicopter has lost", "PLAIN",10] call RE;
EPOCH_EVENT_RUNNING = false;
};

if (_playerPresent) exitWith {

//------------------------------------------------------------------------------------------------------------------------------------------------------------//
/////////////////////////////////////////////////SPAWN THE HELI AND AI/////////////////////////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------------------------------------------------------------------------------------------------//

_aiskin = "Survivor2_DZ";

_this = createCenter west;
_center_1 = _this;
_unitGroup = createGroup _center_1;
//

//spawnai
_pilot = objNull;
_pilot = _unitGroup createUnit [_aiskin, [0,0,0], [], 1, "NONE"];
_pilot addEventHandler ["handleDamage", {false}];
[_pilot] joinSilent _unitGroup;

sleep 1;
_heli_class = "Mi17_DZE";
_helicopter =  createVehicle [_heli_class, [(_position select 0) + 4, (_position select 1) + 100],[], 100, "FLY"];
_helicopter         setVehicleVarName "heli";
_helicopter 		setFuel 1;
_helicopter 		engineOn true;
_helicopter 		setVehicleAmmo 1;
_helicopter 		flyInHeight 250;
_helicopter 		setVehicleLock "LOCKED";
_helicopter 		addEventHandler ["GetOut",{(_this select 0) setFuel 0;(_this select 0) setDamage 1;}];
_helicopter addEventHandler ["handleDamage", {false}];

dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_helicopter];
_pilot 	assignAsDriver _helicopter;
_pilot 	moveInDriver _helicopter;

//end of heli

_xpos = _position select 0;
_ypos = _position select 1;
// These are 4 waypoints in a NorthSEW around the center
_waypos1 = [_xpos, _ypos+20, 0];
_waypos2 = [_xpos+20, _ypos, 0];
_waypos3 = [_xpos, _ypos-20, 0];
_waypos4 = [_xpos-20, _ypos, 0];
_wp1 = _unitGroup addWaypoint [_waypos1, _waypointsrange];
_wp1 setWaypointType "MOVE";
_wp2 = _unitGroup addWaypoint [_waypos2, _waypointsrange];
_wp2 setWaypointType "MOVE";
_wp3 = _unitGroup addWaypoint [_waypos3, _waypointsrange];
_wp3 setWaypointType "MOVE";
_wp4 = _unitGroup addWaypoint [_waypos4, _waypointsrange];
_wp4 setWaypointType "MOVE";
_waypointend = _unitGroup addWaypoint [[_xpos,_ypos, 0], _waypointsrange];
_waypointend setWaypointType "CYCLE";

sleep 3;

//------------------------------------------------------------------------------------------------------------------------------------------------------------//
/////////////////////////////////////////////////SPAWN CRATES/////////////////////////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------------------------------------------------------------------------------------------------//

_boxtype = "USVehicleBox_EP1";
_getPos = getPos _helicopter;
_positiondrop = [(_getPos select 0)-5, (_getPos select 1)-4, 25];
_positiondrop2 = [(_getPos select 0)+7, (_getPos select 1)-7, 50];
_positiondrop3 = [(_getPos select 0)+5, (_getPos select 1)-3, 40];
_positiondrop4 = [(_getPos select 0)-10, (_getPos select 1)-5, 30];
//

[nil,nil,rTitleText,"supply from above", "PLAIN",10] call RE;

_box = _boxtype createVehicle _positiondrop;
clearweaponcargoglobal _box;
clearmagazinecargoglobal _box;
_chute = createVehicle ["ParachuteMediumEast", getPos _box, [], 0, "FLY"];
_box attachTo [_chute, [0,0,3]];
_smoke = "SmokeShellBlue" createVehicle (getPos _box);
_smoke attachTo [_box, [0,0,0]];

//add loot
{
_box addWeaponCargoGlobal [_x,1];
} forEach (_loot select 0);
{
_box addMagazineCargoGlobal [_x,1];
} forEach (_loot2 select 1);

sleep 3;

_box2 = _boxtype createVehicle _positiondrop2;
clearweaponcargoglobal _box2;
clearmagazinecargoglobal _box2;
_chute2 = createVehicle ["ParachuteMediumEast", getPos _box2, [], 0, "FLY"];
_box2 attachTo [_chute2, [0,0,3]];
_smoke2 = "SmokeShellRed" createVehicle (getPos _box2);
_smoke2 attachTo [_box2, [0,0,0]];

//add loot
{
_box2 addWeaponCargoGlobal [_x,1];
} forEach (_loot3 select 0);
{
_box2 addMagazineCargoGlobal [_x,1];
} forEach (_loot4 select 1);

sleep 3;

_box3 = _boxtype createVehicle _positiondrop3;
clearweaponcargoglobal _box3;
clearmagazinecargoglobal _box3;

_chute3 = createVehicle ["ParachuteMediumEast", getPos _box3, [], 0, "FLY"];
_box3 attachTo [_chute3, [0,0,3]];
_smoke3 = "SmokeShellYellow" createVehicle (getPos _box3);
_smoke3 attachTo [_box3, [0,0,0]];

//add loot
{
_box3 addWeaponCargoGlobal [_x,1];
} forEach (_loot8 select 0);
{
_box3 addMagazineCargoGlobal [_x,1];
} forEach (_loot7 select 1);

sleep 3;

_box4 = _boxtype createVehicle _positiondrop4;
clearweaponcargoglobal _box4;
clearmagazinecargoglobal _box4;
_chute4 = createVehicle ["ParachuteMediumEast", getPos _box4, [], 0, "FLY"];
_box4 attachTo [_chute4, [0,0,3]];
_smoke4 = "SmokeShellGreen" createVehicle (getPos _box4);
_smoke4 attachTo [_box4, [0,0,0]];

//add loot
{
_box4 addWeaponCargoGlobal [_x,1];
} forEach (_loot6 select 0);
{
_box4 addMagazineCargoGlobal [_x,1];
} forEach (_loot5 select 1);

sleep 10;

deleteVehicle _helicopter;
deleteVehicle _pilot;
deleteVehicle _objectslist00;
deleteMarker _follow_marker;
deleteMarker _marker_on_radius;

[nil,nil,rTitleText,"Survivors Take the supplys", "PLAIN",10] call RE;
EPOCH_EVENT_RUNNING = false;
};

сохраняем файл и перемещаем его в папку dayz_server\modules\

3. Готово

Статья взята с сайта: epochmod.com

Понравилась статья? Поставь +

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Присоединяйтесь к обсуждению

Вы можете опубликовать сообщение сейчас, а зарегистрироваться позже. Если у вас есть аккаунт, войдите в него для написания от своего имени.
Примечание: вашему сообщению потребуется утверждение модератора, прежде чем оно станет доступным.

Гость
Ответить в тему...

×   Вставлено в виде отформатированного текста.   Восстановить форматирование

  Разрешено не более 75 эмодзи.

×   Ваша ссылка была автоматически встроена.   Отобразить как ссылку

×   Ваш предыдущий контент был восстановлен.   Очистить редактор

×   Вы не можете вставить изображения напрямую. Загрузите или вставьте изображения по ссылке.


×
×
  • Создать...