Das ist cool, ich bin erstmal im Urlaub und werde mich danach mal informieren und gucken, was man so machen kann
Beiträge von CptPanther
-
-
Allgemeines
Das Interior_Light Script erstellt eine AddAction, die es ermöglicht in Fahrzeugen und Hubschraubern eine Innenbeleuchtung zuhaben und zu bedienenScript
Zu bearbeitende Datei:-
Altis_Life.Altis\init.sqf
Zu ergänzende Datei:
-
intlight.sqf
1. intlight.sqf
Öffnet euren Altis_Life.Altis Ordner und erstellt einen Ordner mit dem Namen "scripts" bzw. "Scripts", sofern ihr diesen noch nicht habt. Dort erstellt ihr die intlight.sqf und fügt folgenden Code ein:Code: intlight.sqf// // // // // // // // // //// Interior Light script// Version 1.651// Date: 2014.11.11// Authors: Lala14, Tajin// // // // // // // // // //// init line:// nul=[] execVM "IntLight.sqf";/*Definable*/IL_Debug = false; //Enable Debug ModeIL_Balls = false; //Show the attach points (requires Debug mode)IL_Crew_Only = false; //Only allow Pilot/Driver/Co-Pilot/Gunner/Commander (does not include left & right gunners for choppers) to change the lightIL_Red_On_Always = true; //When true, when light is turned off then on the light will be reset to red else it will never be reset if falseIL_Action_Night = false; //Only allow the action to come up during the Dark times/*End Definable*//*Start Script*/IL_Loaded = false;if (isDedicated) exitWith {};waitUntil {!isNull player};systemChat "Interior Lighting: Loading";diag_log "IL starting";// Farbe in RGB Decimal:IL_c_white = [255,255,255];IL_c_red = [255,0,0];IL_c_green = [0,255,0];IL_c_blue = [0,0,255];IL_c_yellow = [255,200,0];IL_c_orange = [255,75,0];// predefined default values used in the config belowIL_attenuation = [0.3,0,0,500];IL_att_soft = [0,10,10,10];IL_att_tiny = [0,0,0,0,0.2,0.4];IL_intensity = 50;// To make all lights brighter or darker, simply adjust the following multiplier.IL_intensity_mult = 1;diag_log "IL config loading";// config ["kindOf classnames","First person only",[["position in modelspace","lightcolor","attentuation","intensity"],[..],"Allow Colour Change",(optional - if not present but there is 2 it will change it) which lights to be able to change to green *first to number* ] ]if (isnil "IL_config") then { IL_config = [] };IL_config = IL_config + [ [["Heli_Light_01_base_F"], false, [ [ [0,1,0.5], IL_c_red, IL_attenuation, IL_intensity ] ],true], [["Heli_Light_02_base_F"], false, [ [ [0,1.7,-0.1], IL_c_red, IL_attenuation, IL_intensity ] ],true], [["Heli_Transport_01_base_F"], false, [ [ [0,2,0], IL_c_red, IL_attenuation, IL_intensity ] ],true], [["I_Heli_light_03_unarmed_base_F","I_Heli_light_03_base_F","I_Heli_light_03_F","I_Heli_light_03_unarmed_F"], false, [ [ [0,2.5,0.5], IL_c_red, IL_attenuation, IL_intensity ] ],true], [["Heli_Transport_02_base_F"], false, [ [ [0,1.5,-0.4], IL_c_red, IL_attenuation, IL_intensity ] ],true], [["B_Heli_Transport_03_base_F"], false, [ [ [0,-2,0.3], IL_c_red, IL_att_soft, 0.5 ], [ [0,4,0.3], IL_c_red, IL_att_soft, 0.5 ] ],true,2], [["O_Heli_Transport_04_covered_F","O_Heli_Transport_04_medevac_F"],false, [ [ [0.2,-1.95,-0.1], IL_c_red, IL_att_soft, 0.5 ], [ [-0.4,-1.95,-0.1], IL_c_red, IL_att_soft, 0.5 ], [ [0.2,0.93,-0.1], IL_c_red, IL_att_soft, 0.5 ], [ [-0.4,0.93,-0.1], IL_c_red, IL_att_soft, 0.5 ], [ [-0.13,3.13,0.35], IL_c_red, IL_att_soft, 0.5 ] ],true,5], [["Land_Pod_Heli_Transport_04_covered_F","Land_Pod_Heli_Transport_04_medevac_F"],false, [ [ [0.3,-0.86,0.5], IL_c_red, IL_att_soft, 0.5 ], [ [-0.3,-0.86,0.5], IL_c_red, IL_att_soft, 0.5 ], [ [0.3,2.02,0.5], IL_c_red, IL_att_soft, 0.5 ], [ [-0.3,2.02,0.5], IL_c_red, IL_att_soft, 0.5 ] ],true,4], [["Heli_Transport_04_base_F"],false, [ [ [-0.13,3.13,0.1], IL_c_red, IL_att_soft, 0.5 ] ],true], [["Heli_Attack_01_base_F"], false, [ [ [-0.04,4.3,-0.3], IL_c_green, [0,0,0,0,0.2,0.4], 0.05 ], [ [-0.04,2.89,0.15], IL_c_green, [0,0,0,0,0.2,0.4], 0.05 ] ],false], [["Heli_Attack_02_base_F"], false, [ [ [0,1.5,-1.5], IL_c_red, IL_attenuation, 5 ], [ [0,0.5,-1.5], IL_c_red, IL_attenuation, 5 ], [ [0.07,3.4,-0.05], IL_c_green, [0,0,0,0,0.2,0.4], 0.05 ], [ [0,4.4,-0.3], IL_c_green, [0,0,0,0,0.2,0.4], 0.05 ] ],true,2], [["c130J_base"], false, [ [ [0,6,-2], IL_c_red, IL_attenuation, IL_intensity ] ],true], [["kyo_MH47E_base"], false, [ [ [0,2,-0.07], IL_c_red, IL_attenuation, IL_intensity ] ],true], [["globemaster_c17"], false, [ [ [0,8,2.44], IL_c_red, IL_attenuation, IL_intensity ] ],true], [["APC_Wheeled_01_base_F"], true, [ [ [0,-3,-0.4], IL_c_red, IL_attenuation, IL_intensity ] ],true], [["APC_Wheeled_02_base_F"], true, [ [ [0.3,-2.7,-0.2], IL_c_red, IL_attenuation, IL_intensity ] ],true], [["APC_Wheeled_03_base_F"], true, [ [ [0.5,-2.6,-0.7], IL_c_red, IL_attenuation, IL_intensity ] ],true], [["MBT_01_base_F"], true, [ [ [0,-2.7,-0.9], IL_c_red, IL_attenuation, IL_intensity ] ],true], [["APC_Tracked_01_base_F"], true, [ [ [0,-2.4,-0.7], IL_c_red, IL_attenuation, IL_intensity ] ],true], [["APC_Tracked_02_base_F"], true, [ [ [0,-3.1,-0.6], IL_c_red, IL_attenuation, IL_intensity ] ],true], [["APC_Tracked_03_base_F"], true, [ [ [0,-2,-0.6], IL_c_red, IL_attenuation, IL_intensity ] ],true], [["B_Truck_01_mover_F"],false, [ [ [0,3.6,0.71], IL_c_orange, IL_att_soft, 10] ], false], [["B_Truck_01_covered_F","B_Truck_01_medical_F"], false, [ [ [0,0,1], IL_c_orange, IL_att_soft, 10 ], [ [0,4,0.42], IL_c_orange, IL_att_soft, 10] ],false], [["B_Truck_01_transport_F","Truck_01_base_F"], false, [ [ [0,4,0.42], IL_c_orange, IL_att_soft, 10] ],false], [["O_Truck_03_covered_F","O_Truck_03_medical_F"], false, [ [ [0,-2,1.2], IL_c_orange, IL_att_soft, 10 ], [ [0,2.7,0.85], IL_c_orange, IL_att_soft, 10] ],false], [["Truck_03_base_F"], false, [ [ [0,2.7,0.85], IL_c_orange, IL_att_soft, 10] ],false], [["I_Truck_02_covered_F","I_Truck_02_medical_F","O_Truck_02_covered_F","O_Truck_02_medical_F"], false, [ [ [0,-0.5,0.89], IL_c_orange, IL_att_soft, 10 ], [ [0,1.5,0.41], IL_c_orange, IL_att_soft, 10] ],false], [["I_Truck_02_box_F","I_Truck_02_fuel_F","I_Truck_02_ammo_F","O_Truck_02_box_F","O_Truck_02_fuel_F","O_Truck_02_ammo_F"], false,[ [ [0,1.5,0.41], IL_c_orange, IL_att_soft, 10] ],false], [["Truck_02_base_F"], false,[ [ [0,3,0.41], IL_c_orange, IL_att_soft, 10] ],false], [["MRAP_01_base_F"], false, [ [ [0,-2.3,0.3], IL_c_orange, IL_att_soft, 0.5] ],false], [["MRAP_02_base_F"], false, [ [ [0,0,1], IL_c_orange, IL_att_soft, 0.5 ] ],false], [["MRAP_03_base_F"], false, [ [ [0,0,0.3], IL_c_orange, IL_att_soft, 0.5 ] ],false], [["Offroad_01_base_F"], false, [ [ [0,0,0.3], IL_c_orange, IL_att_soft, 0.5 ] ],false], [["SUV_01_base_F"], false, [ [ [0,-0.7,0], IL_c_orange, IL_att_soft, 0.5 ] ],false], [["VAN_01_base_F"], false, [ [ [0,0,0.6], IL_c_orange, IL_att_soft, 0.5 ] ],false], [["Hatchback_01_base_F"], false, [ [ [0,0,0.3], IL_c_orange, IL_att_soft, 0.5 ] ],false], [["UH60_Base"], false, [ [ [0,1.5,-0.7], IL_c_red, IL_att_soft, 0.5 ] ],true], [["UH1H_base"], false, [ [ [0,0.7,-0.25], IL_c_red, IL_att_soft, 0.5 ] ],true], [["UH1_Base"], false, [ [ [0,0,-0.1], IL_c_red, IL_att_soft, 0.5 ] ],true], [["CH_47F_base"], false, [ [ [0,-2,-1], IL_c_red, IL_att_soft, 0.5 ], [ [0,3,-0.83], IL_c_red, IL_att_soft, 0.5 ] ],true,2]];// Der Config Array kann modifieziert werden, ohne das gesamte Script umzubearbeiten.diag_log "IL config done";// varsIL_typelist = [];IL_lights = [];IL_varname = "interiorlight";IL_text_ON = "<t color='#FF0000'>Innenlicht AN</t>";IL_text_OFF = "<t color='#FF0000'>Innenlicht AUS</t>";IL_Green_Text = "<t color='#00FF00'>Zu Gruen wechseln</t>";IL_Red_Text = "<t color='#FF0000'>Zu Rot wechseln</t>";IL_action = -1;IL_lastchange = 0;// FunktionIL_fnc_inList = { _found = false; _index = -1; { _types = _x select 0; { if (_this isKindOf _x) exitWith { _found = true; }; } forEach _types; if _found exitWith {_index = _forEachIndex;}; } forEach IL_config; _index};IL_fnc_returnTurretUnits = { _peeps = []; _turrets = allTurrets [_this,false]; { if (!isNull (_this turretUnit _x)) then {_peeps pushBack (_this turretUnit _x)}; }forEach _turrets; _peeps;};IL_fnc_addAction = { if (IL_action > -1) then { player removeAction IL_action; if (IL_Debug) then {player sideChat 'action removed'}; }; IL_action = player addAction [ IL_text_ON, " _veh = vehicle player; _ison = _veh getVariable [IL_varname,false]; if (_ison) then { _veh setVariable[IL_varname,false,true]; } else { _veh setVariable[IL_varname,true,true]; } ", "", 0.999, false, false, "", " _veh = vehicle player; _show = false; if ( (_veh != player) ) then { _vehtype = typeOf _veh; _i = _veh call IL_fnc_inList; if (_i > -1) then { _show = true; _ison = _veh getVariable [IL_varname,false]; if (_ison) then { player setUserActionText[IL_action,IL_text_OFF]; if ( (cameraView != 'INTERNAL') && ((IL_config select _i) select 1) ) then { if (IL_Debug) then {player sideChat 'Lights being removed because in third person'}; if (count IL_lights > 0) then { { IL_lights = IL_lights - [_x]; deleteVehicle _x; } forEach IL_lights; }; } else { _lights = (IL_config select _i) select 2; _timestamp = _veh getVariable ['IL_timestamp',IL_lastchange]; if (count IL_lights == 0) then { if (IL_Debug) then {player sideChat 'lights added, hint displayed for the array'; hintSilent str _lights;}; { _light = '#lightpoint' createVehicleLocal [0,0,0]; _light attachTo [_veh,(_x select 0)]; _light setLightColor (_x select 1); _light setLightAttenuation (_x select 2); _light setLightIntensity (_x select 3) * IL_intensity_mult; if (IL_Debug && IL_Balls) then { if (isNil {_veh getVariable 'il_balls'}) then { _ball = 'Sign_Sphere10cm_F' createVehicle [0,0,0]; _ball attachTo [_veh,(_x select 0)]; _veh setVariable ['il_balls',[_ball],true]; } else { _ball = 'Sign_Sphere10cm_F' createVehicle [0,0,0]; _ball attachTo [_veh,(_x select 0)]; _veh setVariable ['il_balls',(_veh getVariable 'il_balls') + [_ball],true]; }; }; IL_lights pushBack _light; IL_lastchange = 0; } forEach _lights; }; if (_timestamp != IL_lastchange) then { _override = _veh getVariable ['IL_override',_lights]; if (IL_Debug) then {player sideChat format ['light colour changed',str _override];}; { _o = _override select _forEachIndex; _x attachTo [_veh,(_o select 0)]; _x setLightColor (_o select 1); _x setLightAttenuation (_o select 2); _x setLightIntensity (_o select 3) * IL_intensity_mult; } forEach IL_lights; IL_lastchange = _timestamp; }; }; } else { if (IL_Red_On_Always) then { _veh setVariable ['IL_override',nil,true]; }; player setUserActionText[IL_action,IL_text_ON]; if (count IL_lights > 0) then { if (IL_Debug) then {player sideChat format ['removing lights because lights are off %1',str IL_lights];}; { IL_lights = IL_lights - [_x]; deleteVehicle _x; } forEach IL_lights; if ((IL_Debug) && (IL_Balls) && !(isNil {_veh getVariable 'il_balls'})) then { { deleteVehicle _x; } forEach (_veh getVariable 'il_balls'); _veh setVariable ['il_balls',nil,true]; if (IL_Debug) then {player sideChat format ['removing balls because lights are off %1',str IL_lights];}; }; }; }; }; } else { if (count IL_lights > 0) then { if (IL_Debug) then {player sideChat format ['removing lights because you are not in a vehicle %1',str IL_lights];}; { IL_lights = IL_lights - [_x]; deleteVehicle _x; } forEach IL_lights; }; }; if (IL_Crew_Only) then { _show = (_show && ((_this == driver _target) OR (_this == gunner _target) OR (_this == commander _target) OR (_this in (vehicle _target call IL_fnc_returnTurretUnits)))) }; if (IL_Action_Night && sunOrMoon == 1) then { _show = (_show && (vehicle _target getVariable [IL_varname,false] )) }; _show "]; if (IL_Debug) then {player sideChat 'action added'}; if (IL_action2 > -1) then { player removeAction IL_action2; if (IL_Debug) then {player sideChat 'action2 removed'}; }; IL_action2 = player addAction [ IL_Green_Text, " _veh = vehicle player; _i = _veh call IL_fnc_inList; _lights = + (IL_config select _i) select 2; _lighter = _lights select 0; _lightamount = (IL_config select _i) select 4; if (isNil {_veh getVariable 'IL_override'}) then { _lighter set [1,IL_c_green]; if (count _lights > 1 && isNil {_lightamount}) then { _lighters = _lights select 1; _lighters set [1,IL_c_green]; _lights set [1,_lighters]; }; if (!isNil {_lightamount}) then { { _x set [1,IL_c_green]; _lights set [_forEachIndex,_x]; }forEach _lights; }; _lights set [0,_lighter]; _veh setVariable ['IL_override',_lights,true]; _veh setVariable ['IL_timestamp',time,true]; } else { _veh setVariable ['IL_override',nil,true]; _veh setVariable ['IL_timestamp',time,true]; }; ", "", 0.99, false, false, "", " _veh = vehicle player; _i = _veh call IL_fnc_inList; _show = false; if (!(isNil {_veh getVariable 'IL_override'}) && (IL_c_green in ((_veh getVariable 'IL_override') select 0))) then { player setUserActionText[IL_action2,IL_Red_Text];}; if (isNil {_veh getVariable 'IL_override'}) then { player setUserActionText[IL_action2,IL_Green_Text];}; if ((_veh != player) && (_i > -1)) then { _show = ((_i > -1) && ((IL_config select _i) select 3)) }; if (IL_Crew_Only) then { _show = (_show && ((_this == driver _target) OR (_this == gunner _target) OR (_this == commander _target) OR (_this in (vehicle _target call IL_fnc_returnTurretUnits)))) }; _veh getVariable [IL_varname,false] && _show "]; if (IL_Debug) then {player sideChat 'action2 added'}; if (IL_Debug && IL_Crew_Only) then {player sideChat "IL_Crew_Only Active"}; if (IL_Debug && IL_Red_On_Always) then {player sideChat "IL_Red_On_Always Active"};};diag_log "IL func loaded";// init[] spawn IL_fnc_addAction;player addEventHandler ["Respawn", { [] spawn IL_fnc_addAction;}];IL_Loaded = true;diag_log "IL ready";systemChat "Interior Lighting: Initialized";
2. init.sqf
Öffnet die init.sqf in eurem Altis_Life.Altis Ordner (Root) und fügt folgendes ganz unten ein:
nul=[] execVM "scripts\intlight.sqf"; -
Altis_Life.Altis\init.sqf
-
das ist ja eher eine Shisha als ne Zigarette
Ich versuch das mit dem smoke etwas kleiner zu gestalten^^
und ich versuche es, das keine rauchgranate genutzt wird, sondern normaler rauch
vll hast du ja noch eine Idee, wie man etwas machen kannVielen Dank, hab den Fehler beim überlesen nicht gefunden doofy
Ich weiß nicht ob es funktioniert, aber ich meine mal beim Mapping Raucheffekte (wie bei einem Absturz) gesehen zu haben und eventuell kann man diese anstatt der Rauchgranate an den Spieler anbringen. Müsste mal Killergnom ausprobieren, der kann solche Wundern -
Allgemeines
Der folgende Code bewirkt, dass über einem gekauften Fahrzeug (Truck oder PKW) sich ein Pfeil befindet. Dieser ist kein rigidBody und man kann nicht mit diesem kollidieren.
Script
Zu bearbeitende Dateien:
- fn_vehicleShopBuy.sqf
1. fn_vehicleShopBuy.sqf
Öffnet die fn_vehicleShopBuy.sqf in Altis_Life.Altis\core\shops. Fügt den folgenden Code ans Ende ein, sodass der letzte Call ersetzt wird und davor die Variablen stehen.
Code
Alles anzeigen_box = boundingBox _vehicle; _offset = _box select 1; //Gets an array with the maximum bounding values _offset = _offset select 2; //Gets the Maxmimum Z height _offset = _offset + 0.8; //Just a few inches more... _sp = visiblePosition _vehicle; _sp = _sp vectorAdd [0,0,_offset]; _vh = createVehicle ["Sign_Arrow_Large_F", _sp ,[],0,"NONE"]; _vh setPos _sp; [0] call SOCK_fnc_updatePartial; closeDialog 0; //Exit the menu. true; sleep 10; deleteVehicle _vh;
Zum Vergleich ist hier die fn_vehicleShopBuy.sqf von mir:
Spoiler anzeigen
Code: fn_vehicleShopBuy.sqf - TerraGaming
Alles anzeigen/* File: fn_vehicleShopBuy.sqf Author: Bryan "Tonic" Boardwine Description: Does something with vehicle purchasing. */ private["_mode","_spawnPoints","_className","_basePrice","_colorIndex","_spawnPoint","_vehicle"]; _mode = _this select 0; if((lbCurSel 2302) == -1) exitWith {hint localize "STR_Shop_Veh_DidntPick"}; _className = lbData[2302,(lbCurSel 2302)]; _vIndex = lbValue[2302,(lbCurSel 2302)]; _vehicleList = [life_veh_shop select 0] call life_fnc_vehicleListCfg; _basePrice = (_vehicleList select _vIndex) select 1; if(_mode) then {_basePrice = round(_basePrice * 1.5)}; _colorIndex = lbValue[2304,(lbCurSel 2304)]; //Series of checks (YAY!) if(_basePrice < 0) exitWith {}; //Bad price entry if(life_cash < _basePrice) exitWith {hint format[localize "STR_Shop_Veh_NotEnough",[_basePrice - life_cash] call life_fnc_numberText];}; if(!([_className] call life_fnc_vehShopLicenses) && _className != "B_MRAP_01_hmg_F") exitWith {hint localize "STR_Shop_Veh_NoLicense"}; _spawnPoints = life_veh_shop select 1; _spawnPoint = ""; if((life_veh_shop select 0) == "med_air_hs") then { if(count(nearestObjects[(getMarkerPos _spawnPoints),["Air"],35]) == 0) exitWith {_spawnPoint = _spawnPoints}; } else { //Check if there is multiple spawn points and find a suitable spawnpoint. if(typeName _spawnPoints == typeName []) then { //Find an available spawn point. {if(count(nearestObjects[(getMarkerPos _x),["Car","Ship","Air"],5]) == 0) exitWith {_spawnPoint = _x};} foreach _spawnPoints; } else { if(count(nearestObjects[(getMarkerPos _spawnPoints),["Car","Ship","Air"],5]) == 0) exitWith {_spawnPoint = _spawnPoints}; }; }; if(_spawnPoint == "") exitWith {hint localize "STR_Shop_Veh_Block";}; life_cash = life_cash - _basePrice; hint format[localize "STR_Shop_Veh_Bought",getText(configFile >> "CfgVehicles" >> _className >> "displayName"),[_basePrice] call life_fnc_numberText]; //Spawn the vehicle and prep it. if((life_veh_shop select 0) == "med_air_hs") then { _vehicle = createVehicle [_className,[0,0,999],[], 0, "NONE"]; waitUntil {!isNil "_vehicle"}; //Wait? _vehicle allowDamage false; _hs = nearestObjects[getMarkerPos _spawnPoint,["Land_Hospital_side2_F"],50] select 0; _vehicle setPosATL (_hs modelToWorld [-0.4,-4,12.65]); _vehicle lock 2; [[_vehicle,_colorIndex],"life_fnc_colorVehicle",true,false] spawn life_fnc_MP; [_vehicle] call life_fnc_clearVehicleAmmo; [[_vehicle,"trunk_in_use",false,true],"TON_fnc_setObjVar",false,false] spawn life_fnc_MP; [[_vehicle,"vehicle_info_owners",[[getPlayerUID player,profileName]],true],"TON_fnc_setObjVar",false,false] spawn life_fnc_MP; _vehicle disableTIEquipment true; //No Thermals.. They're cheap but addictive. } else { _vehicle = createVehicle [_className, (getMarkerPos _spawnPoint), [], 0, "NONE"]; waitUntil {!isNil "_vehicle"}; //Wait? _vehicle allowDamage false; //Temp disable damage handling.. _vehicle lock 2; _vehicle setVectorUp (surfaceNormal (getMarkerPos _spawnPoint)); _vehicle setDir (markerDir _spawnPoint); _vehicle setPos (getMarkerPos _spawnPoint); [[_vehicle,_colorIndex],"life_fnc_colorVehicle",true,false] spawn life_fnc_MP; [_vehicle] call life_fnc_clearVehicleAmmo; [[_vehicle,"trunk_in_use",false,true],"TON_fnc_setObjVar",false,false] spawn life_fnc_MP; [[_vehicle,"vehicle_info_owners",[[getPlayerUID player,profileName]],true],"TON_fnc_setObjVar",false,false] spawn life_fnc_MP; _vehicle disableTIEquipment true; //No Thermals.. They're cheap but addictive. }; //Side Specific actions. switch(playerSide) do { case west: { [_vehicle,"cop_offroad",true] spawn life_fnc_vehicleAnimate; }; case civilian: { if((life_veh_shop select 2) == "civ" && {_className == "B_Heli_Light_01_F"}) then { [_vehicle,"civ_littlebird",true] spawn life_fnc_vehicleAnimate; }; }; case independent: { [_vehicle,"med_offroad",true] spawn life_fnc_vehicleAnimate; }; }; _vehicle allowDamage true; //life_vehicles set[count life_vehicles,_vehicle]; //Add err to the chain. life_vehicles pushBack _vehicle; [[getPlayerUID player,playerSide,_vehicle,1],"TON_fnc_keyManagement",false,false] spawn life_fnc_MP; if(_mode) then { if(!(_className in ["B_G_Offroad_01_armed_F","B_MRAP_01_hmg_F"])) then { [[(getPlayerUID player),playerSide,_vehicle,_colorIndex],"TON_fnc_vehicleCreate",false,false] spawn life_fnc_MP; }; }; _box = boundingBox _vehicle; _offset = _box select 1; //Gets an array with the maximum bounding values _offset = _offset select 2; //Gets the Maxmimum Z height _offset = _offset + 0.8; //Just a few inches more... _sp = visiblePosition _vehicle; _sp = _sp vectorAdd [0,0,_offset]; _vh = createVehicle ["Sign_Arrow_Large_F", _sp ,[],0,"NONE"]; _vh setPos _sp; [0] call SOCK_fnc_updatePartial; closeDialog 0; //Exit the menu. true; sleep 10; deleteVehicle _vh;
1.2. Damit das Script funktioniert, müsst ihr bei private die Variablen angeben.
Fügt in Zeile 8 folgendes ein bzw. ersetzt es:Spoiler anzeigen
-
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:Code: config.cpp - class TON_Systemsclass 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
Code: config.sqf
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" */ 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;
Code: fn_generateAirdrop.sqf
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;
Code: fn_generateAirdropAuto.sqf
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;
4. init.sqf
Öffnet eure init.sqf im life_server und fügt folgende Zeilen ganz unten hinzu:Code: life_server\init.sqf[] 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
Code: fn_broadcast.sqf
Alles 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]}; }; };
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\airdrop1. 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 place2. 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.Code: Configuration der Lootitems in gen.Airdrop und gen.AirdropAuto
Alles anzeigen// 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
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.Code
Alles anzeigen// 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];};
Übersetzung und Ausarbeitung: CptPanther
Scripting: RyanTT -
Allgemeines:
Es ist zwar nichts besonderes, aber dennoch kann es einen Server bereichern. Es fügt nur die Zigarette als Z-Item hinzu und erzeugt Rauch bei dessen Verwendung.Zu bearbeitende Dateien:
- configuration.sqf
- fn_varToStr.sqf
- fn_varHandle.sqf
- fn_itemWeight.sqf
- fn_useItem.sqf
- fn_virt_shops.sqf
- functions.h
Zu ergänzende Datei:
- fn_usetobacco.sqf
Ort der Dateien:
Spoiler anzeigen
configuration.sqf
Altis_Life.Altis\corefn_varToStr.sqf
Altis_Life.Altis\core\configfn_varHandle.sqf
Altis_Life.Altis\core\configfn_itemWeight.sqf
Altis_Life.Altis\core\configfn_useItem.sqf
Altis_Life.Altis\core\pmenufn_virt_shops.sqf
Altis_Life.Altis\core\configfunctions.h
Altis_Life.Altis\fn_usetobacco.sqf
Altis_Life.Altis\core\actions1. Configuration.sqf
Öffnet die configuration.sqf und fügt in die life_inv_items Sektion das Tobacco hinzu:
"life_inv_tobacco"1.1 Fügt in den buy_array ebenfalls das Tobacco hinzu:
["tobacco",150]Tipp 1:
Spoiler anzeigen
Den Kaufpreis könnt ihr selbst bestimmen, bei mir liegt er bei 150€.
Tipp 2:Spoiler anzeigen
Vergesst ebenfalls nicht ein Komma beim vorletzten Item zusetzen, da ansonsten der Array nicht mehr funktioniert!
Hier ein Beispiel für ein Buy_Array:Spoiler anzeigen
Code: configuration.sqf - buy_array
Alles anzeigenbuy_array = [ ["apple",65], ["rabbit",75], ["salema",55], ["ornate",50], ["mackerel",200], ["tuna",900], ["mullet",300], ["catshark",350], ["water",10], ["turtle",4000], ["turtlesoup",2500], ["donuts",120], ["coffee",10], ["tbacon",75], ["lockpick",150], ["pickaxe",1200], ["redgull",1500], ["fuelF",850], ["peach",68], ["spikeStrip",2500], ["blastingcharge",35000], ["boltcutter",7500], ["defusekit",2500], ["storagesmall",75000], ["gpstracker",2000], //GPS ["diaper",100], ["storagebig",150000], ["tobacco",150] ];
Und hier nochmal eins für den life_inv_items Sektor:Spoiler anzeigen
Code: configuration.sqf - life_inv_items
Alles anzeigenlife_inv_items = [ "life_inv_oilu", "life_inv_oilp", "life_inv_heroinu", "life_inv_heroinp", "life_inv_cannabis", "life_inv_marijuana", "life_inv_apple", "life_inv_rabbit", "life_inv_salema", "life_inv_ornate", "life_inv_mackerel", "life_inv_tuna", "life_inv_mullet", "life_inv_catshark", "life_inv_turtle", "life_inv_fishingpoles", "life_inv_water", "life_inv_donuts", "life_inv_turtlesoup", "life_inv_coffee", "life_inv_fuelF", "life_inv_fuelE", "life_inv_pickaxe", "life_inv_copperore", "life_inv_ironore", "life_inv_ironr", "life_inv_copperr", "life_inv_sand", "life_inv_salt", "life_inv_saltr", "life_inv_glass", "life_inv_tbacon", "life_inv_lockpick", "life_inv_redgull", "life_inv_peach", "life_inv_diamond", "life_inv_coke", "life_inv_cokep", "life_inv_diamondr", "life_inv_spikeStrip", "life_inv_rock", "life_inv_cement", "life_inv_goldbar", "life_inv_blastingcharge", "life_inv_boltcutter", "life_inv_defusekit", "life_inv_storagesmall", "life_inv_storagebig", "life_inv_diaper", "life_inv_dirtydiaper", "life_inv_mais", "life_inv_zucker", "life_inv_brenn", "life_inv_raff", "life_inv_schnaps", "life_inv_benzin", "life_inv_diesel", "life_inv_bauma", "life_inv_gpstracker", //GPS "life_inv_tobacco" ];
2. fn_varToStr.sqf
Öffnet die fn_varToStr.sqf und fügt in die Virtual Inventory Items Sektion folgendes ein:
case "life_inv_tobacco": {"Zigaretten"};3. fn_varHandle.sqf
Öffnet die fn_varHandle.sqf und fügt Folgendes hinzu:case 0:
case "tobacco": {"life_inv_tobacco"};case 1:
case "life_inv_tobacco": {"tobacco"};4. fn_itemWeight.sqf
Öffnet die fn_itemWeight.sqf und fügt euer Tobacco am Ende (unter dem letzten Case) ein:
case "tobacco": {2};Tipp 3:
Spoiler anzeigen
Ihr könnt das Item Gewicht beliebig anpassen. Je nachdem, wie schwer bzw. leicht es ist, nimmt es mehr oder weniger Platz im Spielerinventar ein.
5. fn_usetobacco.sqf
Geht in euren Actions Ordner. Dieser befindet sich in core\actions . Dort erstellt ihr die Datei namens fn_tobacco.sqf und fügt folgendes hinzu:Code: fn_usetobacco.sqf
Alles anzeigen/* File: fn_usetobacco.sqf Author: jakesmithey Description: An effect for smoking a cigarette. */ cutText ["Du hast dir eine Zigarette aus der Packung genommen..","PLAIN",2]; sleep 3; cutText ["Mmmm...Ich werde diese erfrischende, leckere Zigarette geniessen.","PLAIN",2]; _smoke = "SmokeShell" createVehicle position player; if (vehicle player != player) then { _smoke attachTo [vehicle player, [-0.6,-1,0]]; } else { _smoke attachTo [player, [0,-0.1,1.5]]; };
6. fn_useItem.sqf
Öffnet die fn_useItem.sqf und fügt folgendes hinzu:Codecase (_item == "tobacco"): { if(([false,_item,1] call life_fnc_handleInv)) then { [] spawn life_fnc_usetobacco; }; };
Tipp 4:
Spoiler anzeigen
Hier zum Verlgeich meine fn_useItem.sqf
Code: fn_useItem.sqf - CptPanther
Alles anzeigen/* File: fn_useItem.sqf Author: Bryan "Tonic" Boardwine Description: Main function for item effects and functionality through the player menu. */ private["_item"]; disableSerialization; if((lbCurSel 2005) == -1) exitWith {hint localize "STR_ISTR_SelectItemFirst";}; _item = lbData[2005,(lbCurSel 2005)]; switch (true) do { case (_item == "water" or _item == "coffee"): { if(([false,_item,1] call life_fnc_handleInv)) then { life_thirst = 100; player setFatigue 0; }; }; case (_item == "boltcutter"): { [cursorTarget] spawn life_fnc_boltcutter; closeDialog 0; }; case (_item == "blastingcharge"): { player reveal fed_bank; (group player) reveal fed_bank; [cursorTarget] spawn life_fnc_blastingCharge; }; case (_item == "defusekit"): { [cursorTarget] spawn life_fnc_defuseKit; }; case (_item in ["storagesmall","storagebig"]): { [_item] call life_fnc_storageBox; }; case (_item == "redgull"): { if(([false,_item,1] call life_fnc_handleInv)) then { life_thirst = 100; player setFatigue 0; [] spawn { life_redgull_effect = time; titleText[localize "STR_ISTR_RedGullEffect","PLAIN"]; player enableFatigue false; waitUntil {!alive player OR ((time - life_redgull_effect) > (3 * 60))}; player enableFatigue true; }; }; }; case (_item == "spikeStrip"): { if(!isNull life_spikestrip) exitWith {hint localize "STR_ISTR_SpikesDeployment"}; if(([false,_item,1] call life_fnc_handleInv)) then { [] spawn life_fnc_spikeStrip; }; }; case (_item == "fuelF"): { if(vehicle player != player) exitWith {hint localize "STR_ISTR_RefuelInVehicle"}; [] spawn life_fnc_jerryRefuel; }; case (_item == "lockpick"): { [] spawn life_fnc_lockpick; }; case (_item in ["apple","rabbit","salema","ornate","mackerel","tuna","mullet","catshark","turtle","turtlesoup","donuts","tbacon","peach"]): { [_item] call life_fnc_eatFood; }; case (_item == "pickaxe"): { [] spawn life_fnc_pickAxeUse; }; case (_item == "gpstracker"): { [cursorTarget] spawn life_fnc_gpsTracker; }; case (_item == "diaper"): { if(([false,_item,1] call life_fnc_handleInv)) then { life_toilet = 100; [true,"dirtydiaper",1] call life_fnc_handleInv; hint "You put a new diaper on, and you just let it flow. Now you have a dirty diaper - you should better get rid of it before questions get asked."; }; }; case (_item == "brenn"): { if(([false,_item,1] call life_fnc_handleInv)) then { [] spawn life_fnc_usebrenn; }; }; case (_item == "raff"): { if(([false,_item,1] call life_fnc_handleInv)) then { [] spawn life_fnc_useraff; }; }; case (_item == "tobacco"): { if(([false,_item,1] call life_fnc_handleInv)) then { [] spawn life_fnc_usetobacco; }; }; default { hint localize "STR_ISTR_NotUsable"; }; }; [] call life_fnc_p_updateMenu; [] call life_fnc_hudUpdate;
7. fn_virt_shops.sqf
Öffnet die fn_virt_shops.sqf und fügt folgendes zum case "market" hinzu:
"tobacco"Tipp 5:
Spoiler anzeigen
Achtet darauf, dass ihr ein Komma nach dem letzten Item setzt, da ansonsten der Array nicht mehr funktioniert.
Dann kann sowas ungefähr so aussehen:8. functions.h
Öffnet die functions.h und fügt zur Sektion actions eure usetobacco Funktion hinzu:
class usetobacco {};Übersetzung und Ausarbeitung nach: CptPanther
Scripting: jacksmithey