Allgemeines
Dieses Script ermöglicht dynamische Airdrops mit selbst auswählbaren Items darin. Außerdem kann man Airdrops manuell per Command anfordern.
Dies ist ein Only-Server-Side Script!
Das Scripting
Zu bearbeitende Dateien:
- config.cpp
- init.sqf
- fn_broadcast.sqf
Zu ergänzenden Dateien:
- config.sqf
- fn_generateairdrop.sqf
- fn_generateairdropauto.sqf
1. config.cpp
Öffnet eure config.cpp im life_server Ordner. Unter der Sektion "class TON_Systems" fügt ihr folgenden Code hinzu:
class Airdrop
{
file = "\life_server\Functions\airdrop";
class generateAirdrop {};
};
2. Der Airdrop Ordner
Erstellt in \life_server\Functions\ einen Ordner namens "airdrop" .
3. Erstellt nun folgende drei Dateien im Ordner "airdrop"
Spoiler anzeigen
/*
@file Version: 1.0.0.0
@file Author: RYN_Ryan
@file edit: 20.01.2015
Copyright © 2015 Ryan Torzynski, All rights reserved
All servers are allowed to use this code, modify and publish it. Every modified release of this script must contain "Original by RTT"
*/
airdrop_helicopter_main = "B_Heli_Transport_03_unarmed_F";
airdrop_helicopter_scnd = "B_Heli_Attack_01_F";
airdrop_chance = 10;
airdrop_positions = [[6224.38,11925.8,0.00156784],[7592,13856,0.00119019],[10018,12119.2,0.00144005],[9122.34,17830.7,0.00247192]];
_airdrop_time_interval = [1,4]; //Time given in hours, this is the interval in which the airdrop should take place. || GER: Zeiteinteilung in Stunden, das ist das Intervall, indem ein Airdrop stattfinden soll.
// Do not modify the following code
airdrop_time_min = _airdrop_time_interval select 0;
airdrop_time_max = _airdrop_time_interval select 1;
airdrop_time_min = airdrop_time_min*3600;
airdrop_time_max = airdrop_time_max*3600;
if (airdrop_time_min>=airdrop_time_max) exitWith {airdrop_enable=false;};
airdrop_enable=true;
airdrop_goingon=false;
Alles anzeigen
/*
@file Version: 1.0.0.0
@file Author: RYN_Ryan
@file edit: 20.01.2015
Copyright © 2015 Ryan Torzynski, All rights reserved
All servers are allowed to use this code, modify and publish it. Every modified release of this script must contain "Original by RTT"!
*/
_posPlayer = [_this,0,[]] call BIS_fnc_param;
if (!airdrop_enable) exitWith {};
if (airdrop_goingon) exitWith {};
airdrop_goingon = true;
_dest = _posPlayer;
sleep 1;
// AIRDROP STARTEN
[[5,"<t size='1.2'><t color='#FF0000'>Airdrop-Mission</t></t><br/><br/><t size='1'>Ein Helikopter wirft eine Lieferung in 15min ab! Der Abwurfort wird noch durchgegeben!</t>"],"life_fnc_broadcast",true,false] spawn life_fnc_MP;
sleep 300;
_marker = createMarker ["Airdropmarker", _dest];
"Airdropmarker" setMarkerColor "ColorRed";
"Airdropmarker" setMarkerType "Empty";
"Airdropmarker" setMarkerShape "ELLIPSE";
"Airdropmarker" setMarkerSize [500,500];
_markerText = createMarker ["Airdropmarkertext", _dest];
"Airdropmarkertext" setMarkerColor "ColorBlack";
"Airdropmarkertext" setMarkerText "Airdrop";
"Airdropmarkertext" setMarkerType "mil_warning";
[[5,"<t size='1.2'><t color='#FF0000'>Airdrop</t></t><br/><br/><t size='1'>10 Minuten bis zum Abwurf! Check deine Karte für die AZ!</t>"],"life_fnc_broadcast",true,false] spawn life_fnc_MP;
sleep 300;
[[5,"<t size='1.2'><t color='#FF0000'>Airdrop</t></t><br/><br/><t size='1'>5 Minuten bis zum Abwurf!</t>"],"life_fnc_broadcast",true,false] spawn life_fnc_MP;
sleep 60;
[[5,"<t size='1.2'><t color='#FF0000'>Airdrop</t></t><br/><br/><t size='1'>4 Minuten bis zum Abwurf!</t>"],"life_fnc_broadcast",true,false] spawn life_fnc_MP;
sleep 60;
[[5,"<t size='1.2'><t color='#FF0000'>Airdrop</t></t><br/><br/><t size='1'>3 Minuten bis zum Abwurf!</t>"],"life_fnc_broadcast",true,false] spawn life_fnc_MP;
sleep 60;
[[5,"<t size='1.2'><t color='#FF0000'>Airdrop</t></t><br/><br/><t size='1'>2 Minuten bis zum Abwurf!</t>"],"life_fnc_broadcast",true,false] spawn life_fnc_MP;
sleep 60;
[[5,"<t size='1.2'><t color='#FF0000'>Airdrop</t></t><br/><br/><t size='1'>1 bis zum Abwurf!</t>"],"life_fnc_broadcast",true,false] spawn life_fnc_MP;
heli1 = CreateVehicle [airdrop_helicopter_main, [7950, 9667, 0], [], 0, "FLY"];
heli2 = CreateVehicle [airdrop_helicopter_scnd, [7950, 9700, 0], [], 0, "FLY"];
heli3 = CreateVehicle [airdrop_helicopter_scnd, [7950, 9630, 0], [], 0, "FLY"];
heli1 allowDamage false;
heli2 allowDamage false;
heli3 allowDamage false;
_mygroup1 = [[7950, 9667, 0], CIVILIAN, ["O_G_Soldier_SL_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
_mygroup2 = [[7950, 9667, 0], CIVILIAN, ["O_G_Soldier_SL_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
_mygroup3 = [[7950, 9667, 0], CIVILIAN, ["O_G_Soldier_SL_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
{_x moveInDriver heli1} forEach units _mygroup1;
{_x moveInDriver heli2} forEach units _mygroup2;
{_x moveInDriver heli3} forEach units _mygroup3;
_mygroup1 addWaypoint [_dest, 0];
_mygroup1 addWaypoint [[2380.47,22267.8,0], 0];
_mygroup2 addWaypoint [_dest, 0];
_mygroup2 addWaypoint [[2380.47,22267.8,0], 0];
_mygroup3 addWaypoint [_dest, 0];
_mygroup3 addWaypoint [[2380.47,22267.8,0], 0];
_markerText = createMarker ["airbox_marker", [14028.5,18719.7,0.0014267]];
"airbox_marker" setMarkerColor "ColorBlue";
"airbox_marker" setMarkerText " Airdrop-Box";
"airbox_marker" setMarkerType "mil_destroy";
_containerdummy = createVehicle ["Land_Cargo20_blue_F", [3450.7363, 16708.432, 90], [], 0, "CAN_COLLIDE"];
_containerdummy attachTo [heli1,[0,0,-3.5]];
_containerdummy setDir 90;
while { _dest distance heli1 > 250 } do { "airbox_marker" setMarkerPos getPos heli1; sleep 1; };
[[5,"<t size='1.2'><t color='#FF0000'>Airdrop</t></t><br/><br/><t size='1'>Der Versorgungscontainer wurde abgeworfen! 20 Minuten bis zur Selbstzerstörung!</t>"],"life_fnc_broadcast",true,false] spawn life_fnc_MP;
// Drop the container
deleteVehicle _containerdummy;
sleep 0.1;
_container = createVehicle ["Land_Cargo20_blue_F", [3450.7363, 16708.432, 90], [], 0, "CAN_COLLIDE"];
_para = createVehicle ["O_Parachute_02_F", [getPos heli1 select 0, getPos heli1 select 1, getPos heli1 select 2], [], 0, ""];
_para setPosATL (heli1 modelToWorld[0,0,100]);
_para attachTo [heli1,[0,0,-10]];
detach _para;
_container attachTo [_para,[0,0,-2]];
_container setDir 90;
playSound3D ["a3\sounds_f\weapons\Flare_Gun\flaregun_1_shoot.wss", _container];
_smoke="SmokeShellGreen" createVehicle [getpos _container select 0, getpos _container select 1,0];
_smoke attachTo [_container,[0,0,0]];
_light = "Chemlight_green" createVehicle getPos _container;
_light attachTo [_container,[0,0,0]];
_flare = "F_40mm_Green" createVehicle getPos _container;
_flare attachTo [_container,[0,0,0]];
sleep 0.1;
while { (getPos _container select 2) > 2 } do { "airbox_marker" setMarkerPos getPos _container;sleep 1; };
detach _container;
_container setPos [getPos _container select 0, getPos _container select 1, (getPos _container select 2)+0.5];
playSound3D ["A3\Sounds_F\sfx\alarm_independent.wss", _container];
sleep 6;
"M_NLAW_AT_F" createVehicle [getPos _container select 0, getPos _container select 1, 0];
_pos_container = getPos _container;
deleteVehicle _container;
sleep 0.5;
_box = createVehicle ["CargoNet_01_box_F", _pos_container, [], 0, "CAN_COLLIDE"];
_box allowDamage false;
_smoke="SmokeShellGreen" createVehicle [getpos _box select 0,getpos _box select 1,0];
_flare = "F_40mm_Green" createVehicle getPos _container;
_light attachTo [_box,[0,0,0]];
_flare attachTo [_box,[0,0,0]];
// Fill box
clearWeaponCargoGlobal _box;
clearMagazineCargoGlobal _box;
clearItemCargoGlobal _box;
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["arifle_MX_SW_Black_F", 1];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addMagazineCargoGlobal ["30Rnd_65x39_caseless_mag", 50];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["arifle_MX_GL_F", 5];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addMagazineCargoGlobal ["30Rnd_556x45_Stanag_Tracer_Yellow", 50];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addMagazineCargoGlobal ["3Rnd_UGL_FlareRed_F", 20];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["arifle_MX_F", 1];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addMagazineCargoGlobal ["30Rnd_556x45_Stanag_Tracer_Yellow", 50];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["srifle_EBR_F", 5];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["srifle_DMR_01_F", 5];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["arifle_Katiba_GL_F", 5];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["hgun_Pistol_heavy_01_F", 5];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["arifle_MXM_F", 1];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["30Rnd_65x39_caseless_mag", 20];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["LMG_Mk200_F", 1];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addMagazineCargoGlobal ["200Rnd_65x39_cased_Box", 2];};
sleep 0.1;
// Fill box end
sleep 300;
deleteVehicle heli1;
deleteVehicle heli2;
deleteVehicle heli3;
sleep 600;
[[5,"<t size='1.2'><t color='#FF0000'>Airdrop</t></t><br/><br/><t size='1'>5 Minuten bis zur Selbstzerstörung</t>"],"life_fnc_broadcast",true,false] spawn life_fnc_MP;
sleep 240;
[[5,"<t size='1.2'><t color='#FF0000'>Airdrop</t></t><br/><br/><t size='1'>1 Minuten bis zur Selbstzerstörung</t>"],"life_fnc_broadcast",true,false] spawn life_fnc_MP;
sleep 50;
[[5,"<t size='1.2'><t color='#FF0000'>Airdrop</t></t><br/><br/><t size='1'>10 Sekunden bis zur Selbstzerstörung</t>"],"life_fnc_broadcast",true,false] spawn life_fnc_MP;
sleep 10;
[[5,"<t size='1.2'><t color='#FF0000'>Airdrop-Mission beendet!</t></t><br/><br/><t size='1'>Die Airdrop Mission wurde beendet!</t>"],"life_fnc_broadcast",true,false] spawn life_fnc_MP;
deleteVehicle _box;
_bmb = "BO_GBU12_LGB" createVehicle [(getPos _box select 0)-21,(getPos _box select 1)+21,0];
sleep 1;
_bmb = "BO_GBU12_LGB" createVehicle [(getPos _box select 0)-1,(getPos _box select 1)+56,0];
sleep 1;
_bmb = "BO_GBU12_LGB" createVehicle [(getPos _box select 0)+23,(getPos _box select 1)-75,0];
sleep 1;
_bmb = "BO_GBU12_LGB" createVehicle [(getPos _box select 0)-50,(getPos _box select 1)+1,0];
sleep 1;
_bmb = "BO_GBU12_LGB" createVehicle [(getPos _box select 0)+87,(getPos _box select 1)-22,0];
sleep 1;
_bmb = "BO_GBU12_LGB" createVehicle [(getPos _box select 0)+0,(getPos _box select 1)-0,0];
sleep 1;
_bmb = "BO_GBU12_LGB" createVehicle [(getPos _box select 0)+20,(getPos _box select 1)-20,0];
sleep 1;
_bmb = "BO_GBU12_LGB" createVehicle [(getPos _box select 0)-100,(getPos _box select 1)+56,0];
sleep 1;
_bmb = "BO_GBU12_LGB" createVehicle [(getPos _box select 0)+100,(getPos _box select 1)-100,0];
sleep 1;
_bmb = "BO_GBU12_LGB" createVehicle [(getPos _box select 0)-55,(getPos _box select 1)+123,0];
sleep 1;
_bmb = "BO_GBU12_LGB" createVehicle [(getPos _box select 0)+577,(getPos _box select 1)-83,0];
sleep 1;
_bmb = "BO_GBU12_LGB" createVehicle [(getPos _box select 0)+35,(getPos _box select 1)-99,0];
sleep 1;
_bmb = "BO_GBU12_LGB" createVehicle [(getPos _box select 0)+100,(getPos _box select 1)-100,0];
sleep 1;
_bmb = "BO_GBU12_LGB" createVehicle [(getPos _box select 0)-431,(getPos _box select 1)-431,0];
"Airdropmarker" setMarkerAlpha 0;
"Airdropmarkertext" setMarkerAlpha 0;
deleteMarker "airbox_marker";
deleteMarker "Airdropmarker";
deleteMarker "Airdropmarkertext";
airdrop_goingon = false;
Alles anzeigen
/*
@file Version: 1.0.0.0
@file Author: RYN_Ryan
@file edit: 20.01.2015
Copyright © 2015 Ryan Torzynski, All rights reserved
All servers are allowed to use this code, modify and publish it. Every modified release of this script must contain "Original by RTT"!
*/
sleep 1;
if (!airdrop_enable) exitWith {};
if (airdrop_goingon) exitWith {};
_chance = floor(random 100);
if (_chance>airdrop_chance) exitWith {};
_toWait = (random (airdrop_time_max - airdrop_time_min)) + airdrop_time_min;
sleep _toWait; // Wait abit for the airdrop
if (!airdrop_enable) exitWith {};
if (airdrop_goingon) exitWith {};
airdrop_goingon=true;
// AIRDROP STARTEN
[[5,"<t size='1.2'><t color='#FF0000'>Airdrop-Mission</t></t><br/><br/><t size='1'>Ein Helikopter wirft in 15 Minuten einen Versorgungs Container ab! Der Abwurfort wird bald durchgegeben!</t>"],"life_fnc_broadcast",true,false] spawn life_fnc_MP;
_poses = count airdrop_positions;
_inArr = floor(random _poses);
_dest = airdrop_positions select _inArr;
sleep 300;
_marker = createMarker ["Airdropmarker", _dest];
"Airdropmarker" setMarkerColor "ColorRed";
"Airdropmarker" setMarkerType "Empty";
"Airdropmarker" setMarkerShape "ELLIPSE";
"Airdropmarker" setMarkerSize [500,500];
_markerText = createMarker ["Airdropmarkertext", _dest];
"Airdropmarkertext" setMarkerColor "ColorBlack";
"Airdropmarkertext" setMarkerText "Airdrop";
"Airdropmarkertext" setMarkerType "mil_warning";
[[5,"<t size='1.2'><t color='#FF0000'>Airdrop-Mission</t></t><br/><br/><t size='1'>10 Minuten bis zum Abwurf! Check deine Karte für die AZ!</t>"],"life_fnc_broadcast",true,false] spawn life_fnc_MP;
sleep 300;
[[5,"<t size='1.2'><t color='#FF0000'>Airdrop</t></t><br/><br/><t size='1'>5 Minuten bis zum Abwurf!</t>"],"life_fnc_broadcast",true,false] spawn life_fnc_MP;
sleep 60;
[[5,"<t size='1.2'><t color='#FF0000'>Airdrop</t></t><br/><br/><t size='1'>4 Minuten bis zum Abwurf!</t>"],"life_fnc_broadcast",true,false] spawn life_fnc_MP;
sleep 60;
[[5,"<t size='1.2'><t color='#FF0000'>Airdrop</t></t><br/><br/><t size='1'>3 Minuten bis zum Abwurf!</t>"],"life_fnc_broadcast",true,false] spawn life_fnc_MP;
sleep 60;
[[5,"<t size='1.2'><t color='#FF0000'>Airdrop</t></t><br/><br/><t size='1'>2 Minuten bis zum Abwurf!</t>"],"life_fnc_broadcast",true,false] spawn life_fnc_MP;
sleep 60;
[[5,"<t size='1.2'><t color='#FF0000'>Airdrop</t></t><br/><br/><t size='1'>1 Minute bis zum Abwurf!</t>"],"life_fnc_broadcast",true,false] spawn life_fnc_MP;
heli1 = CreateVehicle [airdrop_helicopter_main, [7950, 9667, 0], [], 0, "FLY"];
heli2 = CreateVehicle [airdrop_helicopter_scnd, [7950, 9700, 0], [], 0, "FLY"];
heli3 = CreateVehicle [airdrop_helicopter_scnd, [7950, 9630, 0], [], 0, "FLY"];
heli1 allowDamage false;
heli2 allowDamage false;
heli3 allowDamage false;
_mygroup1 = [[7950, 9667, 0], CIVILIAN, ["O_G_Soldier_SL_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
_mygroup2 = [[7950, 9667, 0], CIVILIAN, ["O_G_Soldier_SL_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
_mygroup3 = [[7950, 9667, 0], CIVILIAN, ["O_G_Soldier_SL_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
{_x moveInDriver heli1} forEach units _mygroup1;
{_x moveInDriver heli2} forEach units _mygroup2;
{_x moveInDriver heli3} forEach units _mygroup3;
_mygroup1 addWaypoint [_dest, 0];
_mygroup1 addWaypoint [[2380.47,22267.8,0], 0];
_mygroup2 addWaypoint [_dest, 0];
_mygroup2 addWaypoint [[2380.47,22267.8,0], 0];
_mygroup3 addWaypoint [_dest, 0];
_mygroup3 addWaypoint [[2380.47,22267.8,0], 0];
_markerText = createMarker ["airbox_marker", [14028.5,18719.7,0.0014267]];
"airbox_marker" setMarkerColor "ColorBlue";
"airbox_marker" setMarkerText " Airdrop-Box";
"airbox_marker" setMarkerType "mil_destroy";
_containerdummy = createVehicle ["Land_Cargo20_blue_F", [3450.7363, 16708.432, 90], [], 0, "CAN_COLLIDE"];
_containerdummy attachTo [heli1,[0,0,-3.5]];
_containerdummy setDir 90;
while { _dest distance heli1 > 250 } do { "airbox_marker" setMarkerPos getPos heli1; sleep 1; };
[[5,"<t size='1.2'><t color='#FF0000'>Airdrop</t></t><br/><br/><t size='1'>Der Versorgungs Container wurde abgeworfen! 20 Minuten bis zur Selbstzerstörung!</t>"],"life_fnc_broadcast",true,false] spawn life_fnc_MP;
// Drop the container
deleteVehicle _containerdummy;
sleep 0.1;
_container = createVehicle ["Land_Cargo20_blue_F", [3450.7363, 16708.432, 90], [], 0, "CAN_COLLIDE"];
_para = createVehicle ["O_Parachute_02_F", [getPos heli1 select 0, getPos heli1 select 1, getPos heli1 select 2], [], 0, ""];
_para setPosATL (heli1 modelToWorld[0,0,100]);
_para attachTo [heli1,[0,0,-10]];
detach _para;
_container attachTo [_para,[0,0,-2]];
_container setDir 90;
playSound3D ["a3\sounds_f\weapons\Flare_Gun\flaregun_1_shoot.wss", _container];
_smoke="SmokeShellGreen" createVehicle [getpos _container select 0, getpos _container select 1,0];
_smoke attachTo [_container,[0,0,0]];
_light = "Chemlight_green" createVehicle getPos _container;
_light attachTo [_container,[0,0,0]];
_flare = "F_40mm_Green" createVehicle getPos _container;
_flare attachTo [_container,[0,0,0]];
sleep 0.1;
while { (getPos _container select 2) > 2 } do { "airbox_marker" setMarkerPos getPos _container;sleep 1; };
detach _container;
_container setPos [getPos _container select 0, getPos _container select 1, (getPos _container select 2)+0.5];
playSound3D ["A3\Sounds_F\sfx\alarm_independent.wss", _container];
sleep 6;
"M_NLAW_AT_F" createVehicle [getPos _container select 0, getPos _container select 1, 0];
_pos_container = getPos _container;
deleteVehicle _container;
sleep 0.5;
_box = createVehicle ["CargoNet_01_box_F", _pos_container, [], 0, "CAN_COLLIDE"];
_box allowDamage false;
_smoke="SmokeShellGreen" createVehicle [getpos _box select 0,getpos _box select 1,0];
_flare = "F_40mm_Green" createVehicle getPos _container;
_light attachTo [_box,[0,0,0]];
_flare attachTo [_box,[0,0,0]];
// Fill box
clearWeaponCargoGlobal _box;
clearMagazineCargoGlobal _box;
clearItemCargoGlobal _box;
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["arifle_MX_SW_Black_F", 1];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addMagazineCargoGlobal ["30Rnd_65x39_caseless_mag", 50];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["arifle_MX_GL_F", 5];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addMagazineCargoGlobal ["30Rnd_556x45_Stanag_Tracer_Yellow", 50];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addMagazineCargoGlobal ["3Rnd_UGL_FlareRed_F", 20];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["arifle_MX_F", 1];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addMagazineCargoGlobal ["30Rnd_556x45_Stanag_Tracer_Yellow", 50];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["srifle_EBR_F", 5];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["srifle_DMR_01_F", 5];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["arifle_Katiba_GL_F", 5];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["hgun_Pistol_heavy_01_F", 5];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["arifle_MXM_F", 1];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["30Rnd_65x39_caseless_mag", 20];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["LMG_Mk200_F", 1];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addMagazineCargoGlobal ["200Rnd_65x39_cased_Box", 2];};
sleep 0.1;
// Fill box end
sleep 300;
deleteVehicle heli1;
deleteVehicle heli2;
deleteVehicle heli3;
sleep 600;
[[5,"<t size='1.2'><t color='#FF0000'>Airdrop</t></t><br/><br/><t size='1'>5 Minuten bis zur Selbstzerstörung</t>"],"life_fnc_broadcast",true,false] spawn life_fnc_MP;
sleep 240;
[[5,"<t size='1.2'><t color='#FF0000'>Airdrop</t></t><br/><br/><t size='1'>1 Minuten bis zur Selbstzerstörung</t>"],"life_fnc_broadcast",true,false] spawn life_fnc_MP;
sleep 50;
[[5,"<t size='1.2'><t color='#FF0000'>Airdrop</t></t><br/><br/><t size='1'>10 Sekunden bis zur Selbstzerstörung</t>"],"life_fnc_broadcast",true,false] spawn life_fnc_MP;
sleep 10;
[[5,"<t size='1.2'><t color='#FF0000'>Airdrop-Mission beendet!</t></t><br/><br/><t size='1'>Die AirDrop-Mission wurde beendet!</t>"],"life_fnc_broadcast",true,false] spawn life_fnc_MP;
deleteVehicle _box;
_bmb = "BO_GBU12_LGB" createVehicle [(getPos _box select 0)-21,(getPos _box select 1)+21,0];
sleep 1;
_bmb = "BO_GBU12_LGB" createVehicle [(getPos _box select 0)-1,(getPos _box select 1)+56,0];
sleep 1;
_bmb = "BO_GBU12_LGB" createVehicle [(getPos _box select 0)+23,(getPos _box select 1)-75,0];
sleep 1;
_bmb = "BO_GBU12_LGB" createVehicle [(getPos _box select 0)-50,(getPos _box select 1)+1,0];
sleep 1;
_bmb = "BO_GBU12_LGB" createVehicle [(getPos _box select 0)+87,(getPos _box select 1)-22,0];
sleep 1;
_bmb = "BO_GBU12_LGB" createVehicle [(getPos _box select 0)+0,(getPos _box select 1)-0,0];
sleep 1;
_bmb = "BO_GBU12_LGB" createVehicle [(getPos _box select 0)+20,(getPos _box select 1)-20,0];
sleep 1;
_bmb = "BO_GBU12_LGB" createVehicle [(getPos _box select 0)-100,(getPos _box select 1)+56,0];
sleep 1;
_bmb = "BO_GBU12_LGB" createVehicle [(getPos _box select 0)+100,(getPos _box select 1)-100,0];
sleep 1;
_bmb = "BO_GBU12_LGB" createVehicle [(getPos _box select 0)-55,(getPos _box select 1)+123,0];
sleep 1;
_bmb = "BO_GBU12_LGB" createVehicle [(getPos _box select 0)+577,(getPos _box select 1)-83,0];
sleep 1;
_bmb = "BO_GBU12_LGB" createVehicle [(getPos _box select 0)+35,(getPos _box select 1)-99,0];
sleep 1;
_bmb = "BO_GBU12_LGB" createVehicle [(getPos _box select 0)+100,(getPos _box select 1)-100,0];
sleep 1;
_bmb = "BO_GBU12_LGB" createVehicle [(getPos _box select 0)-431,(getPos _box select 1)-431,0];
"Airdropmarker" setMarkerAlpha 0;
"Airdropmarkertext" setMarkerAlpha 0;
deleteMarker "airbox_marker";
deleteMarker "Airdropmarker";
deleteMarker "Airdropmarkertext";
airdrop_goingon = false;
Alles anzeigen
4. init.sqf
Öffnet eure init.sqf im life_server und fügt folgende Zeilen ganz unten hinzu:
[] execVM "\life_server\Functions\airdrop\config.sqf";
[] execVM "\life_server\Functions\airdrop\fn_generateAirdropAuto.sqf";
5. Ersetzen der fn_broadcast.sqf
Geht in euren Missions Ordner in functions\network und öffnet die fn_broadcast.sqf und ersetzt alles mit folgendem Code, um den Broadcast zu ermöglichen:
Spoiler anzeigen
/*
File: fn_broadcast.sqf
Author: Bryan "Tonic" Boardwine
Description:
Broadcast system used in the life mission for multi-notification purposes.
*/
private["_type","_message"];
_type = [_this,0,0,[[],0]] call BIS_fnc_param;
_message = [_this,1,"",[""]] call BIS_fnc_param;
_localize = [_this,2,false,[false]] call BIS_fnc_param;
if(_message == "") exitwith {};
if(_localize) exitWith {
_arr = _this select 3;
_msg = switch(count _arr) do {
case 0: {localize _message;};
case 1: {format[localize _message,_arr select 0];};
case 2: {format[localize _message,_arr select 0, _arr select 1];};
case 3: {format[localize _message,_arr select 0, _arr select 1, _arr select 2];};
case 4: {format[localize _message,_arr select 0, _arr select 1, _arr select 2, _arr select 3];};
};
if(typeName _type == typeName []) then {
for "_i" from 0 to (count _type)-1 do
{
switch((_type select _i)) do
{
case 0: {systemChat _msg;};
case 1: {hint _msg;};
case 2: {titleText[_msg,"PLAIN"];};
};
};
} else {
switch (_type) do
{
case 0: {systemChat _msg;};
case 1: {hint _msg;};
case 2: {titleText[_msg,"PLAIN"];};
};
};
};
if(typeName _type == typeName []) then
{
for "_i" from 0 to (count _type)-1 do
{
switch((_type select _i)) do
{
case 0: {systemChat _message};
case 1: {hint format["%1", _message]};
case 2: {titleText[format["%1",_message],"PLAIN"];};
case 5: {hint parseText format["%1", _message]};
};
};
}
else
{
switch (_type) do
{
case 0: {systemChat _message};
case 1: {hint format["%1", _message]};
case 2: {titleText[format["%1",_message],"PLAIN"];};
case 5: {hint parseText format["%1", _message]};
};
};
Alles anzeigen
Einen Airdrop manuell anfordern
Um einen Airdrop manuell anfordern zu können, meldet euch als Admin an und führt folgenden Code in der Debug oder ähnlichem durch:
[[position player],"TON_fnc_generateAirdrop",false,false] spawn life_fnc_MP;
Airdrops personalisieren
Um euren Airdrop zu personalisieren, öffnet einfach eure config.sqf in life_server\Functions\airdrop
1. Airdrop Zeit einstellen
Ersetzt die 1 um die Stunden nach startzustellen, wann ein Airdrop stattfinden. Ersetzt die 4 um die Stunden einzustellen, nachdem eurer Server neustartet.
_airdrop_time_interval = [1,4]; //Time given in hours, this is the interval in which the airdrop should take place
2. Die Airdrop Chance personalisieren
airdrop_chance = 10;
Verändert die 10 in eine andere ganze Zahl zwischen 1 und 100, um die Wahrscheinlichkeit eines Airdrops nach Serverrestart festzulegen.
3. Gegenstände im Container personalisieren
Um die lootbaren Gegenstände der Container zu personalisieren, öffnet fn_generateAirdrop.sqf und fn_generateAirdropAuto.sqf. Bearbeitet den Code wie ihr wollt.
// Fill box
clearWeaponCargoGlobal _box;
clearMagazineCargoGlobal _box;
clearItemCargoGlobal _box;
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["arifle_MX_SW_Black_F", 1];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addMagazineCargoGlobal ["30Rnd_65x39_caseless_mag", 50];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["arifle_MX_GL_F", 5];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addMagazineCargoGlobal ["30Rnd_556x45_Stanag_Tracer_Yellow", 50];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addMagazineCargoGlobal ["3Rnd_UGL_FlareRed_F", 20];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["arifle_MX_F", 1];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addMagazineCargoGlobal ["30Rnd_556x45_Stanag_Tracer_Yellow", 50];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["srifle_EBR_F", 5];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["srifle_DMR_01_F", 5];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["arifle_Katiba_GL_F", 5];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["hgun_Pistol_heavy_01_F", 5];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["arifle_MXM_F", 1];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["30Rnd_65x39_caseless_mag", 20];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["LMG_Mk200_F", 1];};
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addMagazineCargoGlobal ["200Rnd_65x39_cased_Box", 2];};
sleep 0.1;
// Fill box end
Alles anzeigen
4. Neue Gegenstände hinzufügen:
Benutzt folgenden Code Schnipsel als Vorlage und fügt dies vor //Fill box end in fn_generateAirdrop.sqf und fn_generateAirdropAuto.sqf ein.
// Dies fügt Waffen hinzu
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addWeaponCargoGlobal ["WEAPONCLASSNAME", AMOUNT];};
// Dies die dazugehörigen Magazine
sleep 0.1;
_var=floor(random 2);
if (_var==1) then {_box addMagazineCargoGlobal ["MAGAZINECLASSNAME", AMOUNT];};
Alles anzeigen
Übersetzung und Ausarbeitung: CptPanther
Scripting: RyanTT