Henne hast du eine Idee woran es liegen könnte?
Zwei "while"-Schleifen hintereinandern
-
- Altis Life
-
fixle2011 -
26. Februar 2020 um 16:22 -
Erledigt
-
-
Ahh, moment.
Meine Variablen sind ja fast alle so definiert: private _extra2 = "#lightpoint" createVehicleLocal (getPos _vehicle);
Muss ich da dann nicht noch den Parameter definieren?
-
Bitte nutze doch den Codeblock. Ansonsten kann man kaum etwas erkennen und es macht keinen Spaß da durchzuschauen.
Jetzt bekomme ich zwar keine Fehlermeldungen mehr (Variablen), aber das Licht erscheint dennoch nichtmehr. Es passiert einfach garnichts, keine Fehlerausgabe, kein garnichts.
Henne hast du eine Idee woran es liegen könnte?
Mich wundert es sehr, dass du angeblich keine Fehlermeldung erhälst.
Schauen wir uns doch mal an, was du im Code machst:
_right setLightBrightness 0;
Ist doch klar, dass danach das Licht mehr zu erkennen ist.
Ahh, moment.
Meine Variablen sind ja fast alle so definiert: private _extra2 = "#lightpoint" createVehicleLocal (getPos _vehicle);
Muss ich da dann nicht noch den Parameter definieren?
Keine Ahnung was du mir damit sagen willst.
Ist grundsätzlich aber kein Fehler/Problem.
Nachdem du das Licht mit: _right setLightBrightness _brightness;
Vermutlich wieder sichtbar machen willst, ich aber nirgends einen Parameter _brightness erkennen kann, würde ich mal sagen. Ja du musst noch einen Parameter definieren.Du musst übrigens nicht bei beiden spawns, alle Parameter definieren. Es reichen die, die du innerhalb deiner Schleife benötigst.
-
_brightness = [2, 20] select (sunOrMoon isEqualTo 1);
ist in der Schleife an sich definiert, das müsste doch klappen?
-
Tatsache ich wirklich definiert.
Sage ja, ohne Codeblocks ist es schwer zu lesen.
-
Hier mal das komplette Script, vielleicht liegt es an etwas anderem ^^:
Code
Alles anzeigen**// Written by Kupferkarpfen edited by fixle2011 // License: CC BY-NC-SA 4.0 // No interface, no flashlights... if( !hasInterface ) exitWith {}; private _vehicle = param[0, objNull, [objNull]]; if( isNull _vehicle ) exitWith {}; // Sleep a second to allow syncing, if remoteexec was faster than the variable... uisleep 1; if( !(_vehicle getVariable ["lights", false]) ) exitWith {}; private _side = _vehicle getVariable[ "side", sideUnknown ]; if( _side isEqualTo sideUnknown ) exitWith {}; private _colorLeft = switch( _side ) do { case west: { [0.1, 0.1, 20] }; case independent: { [0.1, 0.1, 20] }; default { [] }; }; private _colorRight = switch( _side ) do { case independent; case west: { [0.1, 0.1, 20] }; default { [] }; }; if( _colorLeft isEqualTo [] || _colorRight isEqualTo [] ) exitWith {}; private _attachLeft = switch (typeOf _vehicle) do { case "B_Quadbike_01_F": { [-0.30, 1.0, -0.68] }; case "C_Offroad_01_F": { [-0.37, 0.00, 0.56] }; case "C_Offroad_02_unarmed_F": { [-0.56, 2, -0.6 ] }; case "C_SUV_01_F": { [0.38, 2.26, -0.52] }; //Werte angepasst case "B_MRAP_01_F"; case "B_MRAP_01_hmg_F": { [-1.00, -2.80, 0.55] }; case "C_Hatchback_01_F"; case "C_Hatchback_01_sport_F": { [-0.60, 2.00, -0.95] }; case "I_MRAP_03_F": { [-0.37, 0.00, 0.56] }; // << TODO: This cant be true! case "B_Heli_Light_01_F": { [-0.37, 0.00, 0.56] }; case "I_Heli_light_03_unarmed_F": { [-0.37, 0.00, 0.56] }; case "O_MRAP_02_F": { [-0.37, 0.00, 0.56] }; case "B_Truck_01_transport_F": { [-1.00, -2.80, 0.55] }; case "C_Van_01_box_F": { [-1.00, -0.30, 1.40] }; case "I_Truck_02_ammo_F": { [-1.00, 3.1, 0.57] }; case "I_Truck_02_covered_F": { [-1.00, 3.1, 0.57] }; case "I_Truck_02_transport_F": { [-1.00, 3.1, 0.57] }; case "B_T_LSV_01_unarmed_F": { [-0.72, 2.00, -0.99] }; default { [] }; }; if( _attachLeft isEqualTo []) exitWith {}; private _attachRight = switch (typeOf _vehicle) do { case "B_Quadbike_01_F": { [0.30, 1.0, -0.68] }; case "C_Offroad_01_F": { [0.37, 0.00, 0.56] }; case "C_Offroad_02_unarmed_F": { [0.5, 2, -0.61] }; case "C_SUV_01_F": { [-0.40, 2.26, -0.52] }; //Werte angepasst case "B_MRAP_01_F"; case "B_MRAP_01_hmg_F": { [1.00, -2.80, 0.55] }; case "C_Hatchback_01_F"; case "C_Hatchback_01_sport_F": { [0.60, 2.00, -0.95] }; case "I_MRAP_03_F": { [0.37, 0.00, 0.56] }; // << TODO: This cant be true! case "B_Heli_Light_01_F": { [0.37, 0.00, 0.56] }; case "I_Heli_light_03_unarmed_F": { [0.37, 0.00, 0.56] }; case "O_MRAP_02_F": { [0.37, 0.00, 0.56] }; case "B_Truck_01_transport_F": { [1.00, -2.80, 0.55] }; case "C_Van_01_box_F": { [1.00, -0.30, 1.40] }; case "I_Truck_02_ammo_F": { [1.00, 3.1, 0.57] }; case "I_Truck_02_covered_F": { [1.00, 3.1, 0.57] }; case "I_Truck_02_transport_F": { [1.00, 3.1, 0.57] }; case "B_T_LSV_01_unarmed_F": { [0.72, 2.00, -0.99] }; default { [] }; }; if( _attachRight isEqualTo []) exitWith {}; //Extra Blaulichtpunkte die zusätzlich generiert werden private _attachExtra1 = switch (typeOf _vehicle) do { case "B_Quadbike_01_F": { [0.30, 1.0, -0.68] }; case "C_Offroad_01_F": { [0.37, 0.00, 0.56] }; case "C_Offroad_02_unarmed_F": { [0.5, 2, -0.61] }; case "C_SUV_01_F": { [0.47, -1.75, 0.23] }; //Werte für hinten geändert case "B_MRAP_01_F"; case "B_MRAP_01_hmg_F": { [1.00, -2.80, 0.55] }; case "C_Hatchback_01_F"; case "C_Hatchback_01_sport_F": { [0.60, 2.00, -0.95] }; case "I_MRAP_03_F": { [0.37, 0.00, 0.56] }; // << TODO: This cant be true! case "B_Heli_Light_01_F": { [0.37, 0.00, 0.56] }; case "I_Heli_light_03_unarmed_F": { [0.37, 0.00, 0.56] }; case "O_MRAP_02_F": { [0.37, 0.00, 0.56] }; case "B_Truck_01_transport_F": { [1.00, -2.80, 0.55] }; case "C_Van_01_box_F": { [1.00, -0.30, 1.40] }; case "I_Truck_02_ammo_F": { [1.00, 3.1, 0.57] }; case "I_Truck_02_covered_F": { [1.00, 3.1, 0.57] }; case "I_Truck_02_transport_F": { [1.00, 3.1, 0.57] }; case "B_T_LSV_01_unarmed_F": { [0.72, 2.00, -0.99] }; default { [] }; }; if( _attachExtra1 isEqualTo []) exitWith {}; private _attachExtra2 = switch (typeOf _vehicle) do { case "B_Quadbike_01_F": { [0.30, 1.0, -0.68] }; case "C_Offroad_01_F": { [0.37, 0.00, 0.56] }; case "C_Offroad_02_unarmed_F": { [0.5, 2, -0.61] }; case "C_SUV_01_F": { [-0.49, -1.75, 0.23] }; //Werte für hinten geändert case "B_MRAP_01_F"; case "B_MRAP_01_hmg_F": { [1.00, -2.80, 0.55] }; case "C_Hatchback_01_F"; case "C_Hatchback_01_sport_F": { [0.60, 2.00, -0.95] }; case "I_MRAP_03_F": { [0.37, 0.00, 0.56] }; // << TODO: This cant be true! case "B_Heli_Light_01_F": { [0.37, 0.00, 0.56] }; case "I_Heli_light_03_unarmed_F": { [0.37, 0.00, 0.56] }; case "O_MRAP_02_F": { [0.37, 0.00, 0.56] }; case "B_Truck_01_transport_F": { [1.00, -2.80, 0.55] }; case "C_Van_01_box_F": { [1.00, -0.30, 1.40] }; case "I_Truck_02_ammo_F": { [1.00, 3.1, 0.57] }; case "I_Truck_02_covered_F": { [1.00, 3.1, 0.57] }; case "I_Truck_02_transport_F": { [1.00, 3.1, 0.57] }; case "B_T_LSV_01_unarmed_F": { [0.72, 2.00, -0.99] }; default { [] }; }; if( _attachExtra2 isEqualTo []) exitWith {}; private _left = "#lightpoint" createVehicleLocal (getPos _vehicle); _left lightAttachObject [_vehicle, _attachLeft]; _left setLightColor _colorRight; _left setLightBrightness 0.2; _left setLightAmbient [0.1,0.1,4.5]; _left setLightAttenuation [0.03, 0, 1000, 130]; _left setLightIntensity 10; _left setLightFlareSize 0.38; _left setLightFlareMaxDistance 150; _left setLightUseFlare true; _left setLightDayLight true; private _right = "#lightpoint" createVehicleLocal (getPos _vehicle); _right lightAttachObject [_vehicle, _attachRight]; _right setLightColor _colorRight; _right setLightBrightness 0.2; _right setLightAmbient [0.1,0.1,4.5]; _right setLightAttenuation [0.03, 0, 1000, 130]; _right setLightIntensity 10; _right setLightFlareSize 0.38; _right setLightFlareMaxDistance 150; _right setLightUseFlare true; _right setLightDayLight true; //Hinzufügen der neuen Extralichter private _extra1 = "#lightpoint" createVehicleLocal (getPos _vehicle); _extra1 lightAttachObject [_vehicle, _attachExtra1]; _extra1 setLightColor _colorRight; _extra1 setLightBrightness 0.2; _extra1 setLightAmbient [0.1,0.1,4.5]; _extra1 setLightAttenuation [0.07, 0, 1000, 130]; _extra1 setLightIntensity 10; _extra1 setLightFlareSize 0.38; _extra1 setLightFlareMaxDistance 150; _extra1 setLightUseFlare true; _extra1 setLightDayLight true; private _extra2 = "#lightpoint" createVehicleLocal (getPos _vehicle); _extra2 lightAttachObject [_vehicle, _attachExtra2]; _extra2 setLightColor _colorRight; _extra2 setLightBrightness 0.2; _extra2 setLightAmbient [0.1,0.1,4.5]; _extra2 setLightAttenuation [0.07, 0, 1000, 130]; _extra2 setLightIntensity 10; _extra2 setLightFlareSize 0.38; _extra2 setLightFlareMaxDistance 150; _extra2 setLightUseFlare true; _extra2 setLightDayLight true; [_vehicle, _attachRight, _attachLeft, _attachExtra1, _attachExtra2, _left, _right, _extra1, _extra2] spawn { params ["_vehicle", "_attachRight", "_attachLeft", "_attachExtra1", "_attachExtra2", "_left", "_right", "_extra1", "_extra2"]; while { alive _vehicle && _vehicle getVariable["lights", false] } do { if( player distance _vehicle < 500 ) then { _brightness = [2, 20] select (sunOrMoon isEqualTo 1); _right setLightBrightness 0; uisleep 0.08; _left setLightBrightness _brightness; uisleep 0.08; _left setLightBrightness 0; uisleep 0.08; _left setLightBrightness _brightness; uisleep 0.08; _left setLightBrightness 0; uisleep 0.08; _right setLightBrightness _brightness; uisleep 0.08; _right setLightBrightness 0; uisleep 0.08; _right setLightBrightness _brightness; uisleep 0.08; } else { uisleep 1; }; }; }; //Hinzufügen der Extralichter // DIE SCHLEIFE MAL NACH OBEN SETZEN UM ZU GUCKEN OB ES AN DER SCHLEIFE LIEG; ALSO ERST DIE EXTRAS UND DANN DIE LINKS RECHTS LICHTER AUSFÜHREN [_vehicle, _attachRight, _attachLeft, _attachExtra1, _attachExtra2, _left, _right, _extra1, _extra2] spawn { params ["_vehicle", "_attachRight", "_attachLeft", "_attachExtra1", "_attachExtra2", "_left", "_right", "_extra1", "_extra2"]; while { alive _vehicle && _vehicle getVariable["lights", false] } do { if( player distance _vehicle < 500 ) then { _brightness = [2, 20] select (sunOrMoon isEqualTo 1); _extra1 setLightBrightness 0; uisleep 0.08; _extra2 setLightBrightness _brightness; uisleep 0.08; _extra2 setLightBrightness 0; uisleep 0.08; _extra2 setLightBrightness _brightness; uisleep 0.08; _extra2 setLightBrightness 0; uisleep 0.08; _extra1 setLightBrightness _brightness; uisleep 0.08; _extra1 setLightBrightness 0; uisleep 0.08; _extra1 setLightBrightness _brightness; uisleep 0.08; } else { uisleep 1; }; }; }; deleteVehicle _left; deleteVehicle _right; deleteVehicle _extra1; deletevehicle _extra2;
-
Der Fehler ist wieder witzig.
Der zeigt auch sehr gut, dass es unbedingt notwendig ist, immer den vollen Code zu senden.
Du machst dies hier:
Ich erkläre dir mal den Ablauf des Scripts:
CodeDu prüfst _vehicle. Du schaust nach den Farben für die Lichter. Du schaust nach den Positionen für die Lichter. Du erstellst die Lichter nacheinander. Du startest die 1. Schleife als Scheduled Code. Du startest die 2. Schleife als Scheduled Code. Du löscht die Lichter. Die 1. Schleife fängt an zu arbeiten und setzt die Farben für die Lichter. Die 2. Schleife fängt an zu arbeiten und setzt die Farben für die Lichter.
(so mehr oder weniger)
Ich denke dir fällt auf was Sache ist.
Wenn du die Lichter löschen willst, dann muss du das natürlich machen, nachdem die Schleife fertig ist.
Also die Lichter auch nach der Schleife entfernen.
-
Ahhh, okay. Ist ja logisch wenn man das jetzt so sieht xD. Wie code ich das jetzt, mit einer if Abfrage?
-
-
Code
Alles anzeigen[_vehicle, _attachRight, _attachLeft, _attachExtra1, _attachExtra2, _left, _right, _extra1, _extra2] spawn { params ["_vehicle", "_attachRight", "_attachLeft", "_attachExtra1", "_attachExtra2", "_left", "_right", "_extra1", "_extra2"]; while { alive _vehicle && _vehicle getVariable["lights", false] } do { if( player distance _vehicle < 500 ) then { _brightness = [2, 20] select (sunOrMoon isEqualTo 1); _extra1 setLightBrightness 0; uisleep 0.08; _extra2 setLightBrightness _brightness; uisleep 0.08; _extra2 setLightBrightness 0; uisleep 0.08; _extra2 setLightBrightness _brightness; uisleep 0.08; _extra2 setLightBrightness 0; uisleep 0.08; _extra1 setLightBrightness _brightness; uisleep 0.08; _extra1 setLightBrightness 0; uisleep 0.08; _extra1 setLightBrightness _brightness; uisleep 0.08; } else { uisleep 1; }; }; deleteVehicle _extra1; deletevehicle _extra2; };
So?
-
Richtig.
-
Habe nur auf das "Richtig" gewartet xD. Funktioniert nämlich nicht... Auch keine Fehlermeldung xD...
Code: Der neue Code
Alles anzeigen**// Written by Kupferkarpfen edited by fixle2011 // License: CC BY-NC-SA 4.0 // No interface, no flashlights... if( !hasInterface ) exitWith {}; private _vehicle = param[0, objNull, [objNull]]; if( isNull _vehicle ) exitWith {}; // Sleep a second to allow syncing, if remoteexec was faster than the variable... uisleep 1; if( !(_vehicle getVariable ["lights", false]) ) exitWith {}; private _side = _vehicle getVariable[ "side", sideUnknown ]; if( _side isEqualTo sideUnknown ) exitWith {}; private _colorLeft = switch( _side ) do { case west: { [0.1, 0.1, 20] }; case independent: { [0.1, 0.1, 20] }; default { [] }; }; private _colorRight = switch( _side ) do { case independent; case west: { [0.1, 0.1, 20] }; default { [] }; }; if( _colorLeft isEqualTo [] || _colorRight isEqualTo [] ) exitWith {}; private _attachLeft = switch (typeOf _vehicle) do { case "B_Quadbike_01_F": { [-0.30, 1.0, -0.68] }; case "C_Offroad_01_F": { [-0.37, 0.00, 0.56] }; case "C_Offroad_02_unarmed_F": { [-0.56, 2, -0.6 ] }; case "C_SUV_01_F": { [0.38, 2.26, -0.52] }; //Werte angepasst case "B_MRAP_01_F"; case "B_MRAP_01_hmg_F": { [-1.00, -2.80, 0.55] }; case "C_Hatchback_01_F"; case "C_Hatchback_01_sport_F": { [-0.60, 2.00, -0.95] }; case "I_MRAP_03_F": { [-0.37, 0.00, 0.56] }; // << TODO: This cant be true! case "B_Heli_Light_01_F": { [-0.37, 0.00, 0.56] }; case "I_Heli_light_03_unarmed_F": { [-0.37, 0.00, 0.56] }; case "O_MRAP_02_F": { [-0.37, 0.00, 0.56] }; case "B_Truck_01_transport_F": { [-1.00, -2.80, 0.55] }; case "C_Van_01_box_F": { [-1.00, -0.30, 1.40] }; case "I_Truck_02_ammo_F": { [-1.00, 3.1, 0.57] }; case "I_Truck_02_covered_F": { [-1.00, 3.1, 0.57] }; case "I_Truck_02_transport_F": { [-1.00, 3.1, 0.57] }; case "B_T_LSV_01_unarmed_F": { [-0.72, 2.00, -0.99] }; default { [] }; }; if( _attachLeft isEqualTo []) exitWith {}; private _attachRight = switch (typeOf _vehicle) do { case "B_Quadbike_01_F": { [0.30, 1.0, -0.68] }; case "C_Offroad_01_F": { [0.37, 0.00, 0.56] }; case "C_Offroad_02_unarmed_F": { [0.5, 2, -0.61] }; case "C_SUV_01_F": { [-0.40, 2.26, -0.52] }; //Werte angepasst case "B_MRAP_01_F"; case "B_MRAP_01_hmg_F": { [1.00, -2.80, 0.55] }; case "C_Hatchback_01_F"; case "C_Hatchback_01_sport_F": { [0.60, 2.00, -0.95] }; case "I_MRAP_03_F": { [0.37, 0.00, 0.56] }; // << TODO: This cant be true! case "B_Heli_Light_01_F": { [0.37, 0.00, 0.56] }; case "I_Heli_light_03_unarmed_F": { [0.37, 0.00, 0.56] }; case "O_MRAP_02_F": { [0.37, 0.00, 0.56] }; case "B_Truck_01_transport_F": { [1.00, -2.80, 0.55] }; case "C_Van_01_box_F": { [1.00, -0.30, 1.40] }; case "I_Truck_02_ammo_F": { [1.00, 3.1, 0.57] }; case "I_Truck_02_covered_F": { [1.00, 3.1, 0.57] }; case "I_Truck_02_transport_F": { [1.00, 3.1, 0.57] }; case "B_T_LSV_01_unarmed_F": { [0.72, 2.00, -0.99] }; default { [] }; }; if( _attachRight isEqualTo []) exitWith {}; //Extra Blaulichtpunkte die zusätzlich generiert werden private _attachExtra1 = switch (typeOf _vehicle) do { case "B_Quadbike_01_F": { [0.30, 1.0, -0.68] }; case "C_Offroad_01_F": { [0.37, 0.00, 0.56] }; case "C_Offroad_02_unarmed_F": { [0.5, 2, -0.61] }; case "C_SUV_01_F": { [0.47, -1.75, 0.23] }; //Werte für hinten geändert case "B_MRAP_01_F"; case "B_MRAP_01_hmg_F": { [1.00, -2.80, 0.55] }; case "C_Hatchback_01_F"; case "C_Hatchback_01_sport_F": { [0.60, 2.00, -0.95] }; case "I_MRAP_03_F": { [0.37, 0.00, 0.56] }; // << TODO: This cant be true! case "B_Heli_Light_01_F": { [0.37, 0.00, 0.56] }; case "I_Heli_light_03_unarmed_F": { [0.37, 0.00, 0.56] }; case "O_MRAP_02_F": { [0.37, 0.00, 0.56] }; case "B_Truck_01_transport_F": { [1.00, -2.80, 0.55] }; case "C_Van_01_box_F": { [1.00, -0.30, 1.40] }; case "I_Truck_02_ammo_F": { [1.00, 3.1, 0.57] }; case "I_Truck_02_covered_F": { [1.00, 3.1, 0.57] }; case "I_Truck_02_transport_F": { [1.00, 3.1, 0.57] }; case "B_T_LSV_01_unarmed_F": { [0.72, 2.00, -0.99] }; default { [] }; }; if( _attachExtra1 isEqualTo []) exitWith {}; private _attachExtra2 = switch (typeOf _vehicle) do { case "B_Quadbike_01_F": { [0.30, 1.0, -0.68] }; case "C_Offroad_01_F": { [0.37, 0.00, 0.56] }; case "C_Offroad_02_unarmed_F": { [0.5, 2, -0.61] }; case "C_SUV_01_F": { [-0.49, -1.75, 0.23] }; //Werte für hinten geändert case "B_MRAP_01_F"; case "B_MRAP_01_hmg_F": { [1.00, -2.80, 0.55] }; case "C_Hatchback_01_F"; case "C_Hatchback_01_sport_F": { [0.60, 2.00, -0.95] }; case "I_MRAP_03_F": { [0.37, 0.00, 0.56] }; // << TODO: This cant be true! case "B_Heli_Light_01_F": { [0.37, 0.00, 0.56] }; case "I_Heli_light_03_unarmed_F": { [0.37, 0.00, 0.56] }; case "O_MRAP_02_F": { [0.37, 0.00, 0.56] }; case "B_Truck_01_transport_F": { [1.00, -2.80, 0.55] }; case "C_Van_01_box_F": { [1.00, -0.30, 1.40] }; case "I_Truck_02_ammo_F": { [1.00, 3.1, 0.57] }; case "I_Truck_02_covered_F": { [1.00, 3.1, 0.57] }; case "I_Truck_02_transport_F": { [1.00, 3.1, 0.57] }; case "B_T_LSV_01_unarmed_F": { [0.72, 2.00, -0.99] }; default { [] }; }; if( _attachExtra2 isEqualTo []) exitWith {}; private _left = "#lightpoint" createVehicleLocal (getPos _vehicle); _left lightAttachObject [_vehicle, _attachLeft]; _left setLightColor _colorRight; _left setLightBrightness 0.2; _left setLightAmbient [0.1,0.1,4.5]; _left setLightAttenuation [0.03, 0, 1000, 130]; _left setLightIntensity 10; _left setLightFlareSize 0.38; _left setLightFlareMaxDistance 150; _left setLightUseFlare true; _left setLightDayLight true; private _right = "#lightpoint" createVehicleLocal (getPos _vehicle); _right lightAttachObject [_vehicle, _attachRight]; _right setLightColor _colorRight; _right setLightBrightness 0.2; _right setLightAmbient [0.1,0.1,4.5]; _right setLightAttenuation [0.03, 0, 1000, 130]; _right setLightIntensity 10; _right setLightFlareSize 0.38; _right setLightFlareMaxDistance 150; _right setLightUseFlare true; _right setLightDayLight true; //Hinzufügen der neuen Extralichter private _extra1 = "#lightpoint" createVehicleLocal (getPos _vehicle); _extra1 lightAttachObject [_vehicle, _attachExtra1]; _extra1 setLightColor _colorRight; _extra1 setLightBrightness 0.2; _extra1 setLightAmbient [0.1,0.1,4.5]; _extra1 setLightAttenuation [0.07, 0, 1000, 130]; _extra1 setLightIntensity 10; _extra1 setLightFlareSize 0.38; _extra1 setLightFlareMaxDistance 150; _extra1 setLightUseFlare true; _extra1 setLightDayLight true; private _extra2 = "#lightpoint" createVehicleLocal (getPos _vehicle); _extra2 lightAttachObject [_vehicle, _attachExtra2]; _extra2 setLightColor _colorRight; _extra2 setLightBrightness 0.2; _extra2 setLightAmbient [0.1,0.1,4.5]; _extra2 setLightAttenuation [0.07, 0, 1000, 130]; _extra2 setLightIntensity 10; _extra2 setLightFlareSize 0.38; _extra2 setLightFlareMaxDistance 150; _extra2 setLightUseFlare true; _extra2 setLightDayLight true; [_vehicle, _attachRight, _attachLeft, _attachExtra1, _attachExtra2, _left, _right, _extra1, _extra2] spawn { params ["_vehicle", "_attachRight", "_attachLeft", "_attachExtra1", "_attachExtra2", "_left", "_right", "_extra1", "_extra2"]; while { alive _vehicle && _vehicle getVariable["lights", false] } do { if( player distance _vehicle < 500 ) then { _brightness = [2, 20] select (sunOrMoon isEqualTo 1); _right setLightBrightness 0; uisleep 0.08; _left setLightBrightness _brightness; uisleep 0.08; _left setLightBrightness 0; uisleep 0.08; _left setLightBrightness _brightness; uisleep 0.08; _left setLightBrightness 0; uisleep 0.08; _right setLightBrightness _brightness; uisleep 0.08; _right setLightBrightness 0; uisleep 0.08; _right setLightBrightness _brightness; uisleep 0.08; } else { uisleep 1; }; }; deleteVehicle _left; deleteVehicle _right; }; //Hinzufügen der Extralichter // DIE SCHLEIFE MAL NACH OBEN SETZEN UM ZU GUCKEN OB ES AN DER SCHLEIFE LIEG; ALSO ERST DIE EXTRAS UND DANN DIE LINKS RECHTS LICHTER AUSFÜHREN [_vehicle, _attachRight, _attachLeft, _attachExtra1, _attachExtra2, _left, _right, _extra1, _extra2] spawn { params ["_vehicle", "_attachRight", "_attachLeft", "_attachExtra1", "_attachExtra2", "_left", "_right", "_extra1", "_extra2"]; while { alive _vehicle && _vehicle getVariable["lights", false] } do { if( player distance _vehicle < 500 ) then { _brightness = [2, 20] select (sunOrMoon isEqualTo 1); _extra1 setLightBrightness 0; uisleep 0.08; _extra2 setLightBrightness _brightness; uisleep 0.08; _extra2 setLightBrightness 0; uisleep 0.08; _extra2 setLightBrightness _brightness; uisleep 0.08; _extra2 setLightBrightness 0; uisleep 0.08; _extra1 setLightBrightness _brightness; uisleep 0.08; _extra1 setLightBrightness 0; uisleep 0.08; _extra1 setLightBrightness _brightness; uisleep 0.08; } else { uisleep 1; }; }; deleteVehicle _extra1; deletevehicle _extra2; };
-
Nur um das sicher zustellen. Du schaust schon in die Client Logs?
Bin gerade am durchschauen des Codes.
Füge mal Testausgaben ein um zu sehen was ausgeführt wird.
Vorallem in die Schleifen, aber auch in die exitWiths.
-
Henne habe schon in die Client-Logs geguckt, da steht eifnach gar nichts... (Also nichts im Bezug auf das Script o. ä.)
Habe hint's in das Script eingefügt, aber nichts, egal wo ich die einfüge xD.
Kann es sein das wir irgendetwas kaputt gemacht haben? Sodass es nichtmehr ausgeführt wird?
-
Hier nochmal die Codes im Überblick:
Code: Neueste Version
Alles anzeigen**// Written by Kupferkarpfen edited by fixle2011 // License: CC BY-NC-SA 4.0 // No interface, no flashlights... if( !hasInterface ) exitWith {}; private _vehicle = param[0, objNull, [objNull]]; if( isNull _vehicle ) exitWith {}; // Sleep a second to allow syncing, if remoteexec was faster than the variable... uisleep 1; if( !(_vehicle getVariable ["lights", false]) ) exitWith {}; private _side = _vehicle getVariable[ "side", sideUnknown ]; if( _side isEqualTo sideUnknown ) exitWith {}; private _colorLeft = switch( _side ) do { case west: { [0.1, 0.1, 20] }; case independent: { [0.1, 0.1, 20] }; default { [] }; }; private _colorRight = switch( _side ) do { case independent; case west: { [0.1, 0.1, 20] }; default { [] }; }; if( _colorLeft isEqualTo [] || _colorRight isEqualTo [] ) exitWith {}; private _attachLeft = switch (typeOf _vehicle) do { case "B_Quadbike_01_F": { [-0.30, 1.0, -0.68] }; case "C_Offroad_01_F": { [-0.37, 0.00, 0.56] }; case "C_Offroad_02_unarmed_F": { [-0.56, 2, -0.6 ] }; case "C_SUV_01_F": { [0.38, 2.26, -0.52] }; //Werte angepasst case "B_MRAP_01_F"; case "B_MRAP_01_hmg_F": { [-1.00, -2.80, 0.55] }; case "C_Hatchback_01_F"; case "C_Hatchback_01_sport_F": { [-0.60, 2.00, -0.95] }; case "I_MRAP_03_F": { [-0.37, 0.00, 0.56] }; // << TODO: This cant be true! case "B_Heli_Light_01_F": { [-0.37, 0.00, 0.56] }; case "I_Heli_light_03_unarmed_F": { [-0.37, 0.00, 0.56] }; case "O_MRAP_02_F": { [-0.37, 0.00, 0.56] }; case "B_Truck_01_transport_F": { [-1.00, -2.80, 0.55] }; case "C_Van_01_box_F": { [-1.00, -0.30, 1.40] }; case "I_Truck_02_ammo_F": { [-1.00, 3.1, 0.57] }; case "I_Truck_02_covered_F": { [-1.00, 3.1, 0.57] }; case "I_Truck_02_transport_F": { [-1.00, 3.1, 0.57] }; case "B_T_LSV_01_unarmed_F": { [-0.72, 2.00, -0.99] }; default { [] }; }; if( _attachLeft isEqualTo []) exitWith {}; private _attachRight = switch (typeOf _vehicle) do { case "B_Quadbike_01_F": { [0.30, 1.0, -0.68] }; case "C_Offroad_01_F": { [0.37, 0.00, 0.56] }; case "C_Offroad_02_unarmed_F": { [0.5, 2, -0.61] }; case "C_SUV_01_F": { [-0.40, 2.26, -0.52] }; //Werte angepasst case "B_MRAP_01_F"; case "B_MRAP_01_hmg_F": { [1.00, -2.80, 0.55] }; case "C_Hatchback_01_F"; case "C_Hatchback_01_sport_F": { [0.60, 2.00, -0.95] }; case "I_MRAP_03_F": { [0.37, 0.00, 0.56] }; // << TODO: This cant be true! case "B_Heli_Light_01_F": { [0.37, 0.00, 0.56] }; case "I_Heli_light_03_unarmed_F": { [0.37, 0.00, 0.56] }; case "O_MRAP_02_F": { [0.37, 0.00, 0.56] }; case "B_Truck_01_transport_F": { [1.00, -2.80, 0.55] }; case "C_Van_01_box_F": { [1.00, -0.30, 1.40] }; case "I_Truck_02_ammo_F": { [1.00, 3.1, 0.57] }; case "I_Truck_02_covered_F": { [1.00, 3.1, 0.57] }; case "I_Truck_02_transport_F": { [1.00, 3.1, 0.57] }; case "B_T_LSV_01_unarmed_F": { [0.72, 2.00, -0.99] }; default { [] }; }; if( _attachRight isEqualTo []) exitWith {}; //Extra Blaulichtpunkte die zusätzlich generiert werden private _attachExtra1 = switch (typeOf _vehicle) do { case "B_Quadbike_01_F": { [0.30, 1.0, -0.68] }; case "C_Offroad_01_F": { [0.37, 0.00, 0.56] }; case "C_Offroad_02_unarmed_F": { [0.5, 2, -0.61] }; case "C_SUV_01_F": { [0.47, -1.75, 0.23] }; //Werte für hinten geändert case "B_MRAP_01_F"; case "B_MRAP_01_hmg_F": { [1.00, -2.80, 0.55] }; case "C_Hatchback_01_F"; case "C_Hatchback_01_sport_F": { [0.60, 2.00, -0.95] }; case "I_MRAP_03_F": { [0.37, 0.00, 0.56] }; // << TODO: This cant be true! case "B_Heli_Light_01_F": { [0.37, 0.00, 0.56] }; case "I_Heli_light_03_unarmed_F": { [0.37, 0.00, 0.56] }; case "O_MRAP_02_F": { [0.37, 0.00, 0.56] }; case "B_Truck_01_transport_F": { [1.00, -2.80, 0.55] }; case "C_Van_01_box_F": { [1.00, -0.30, 1.40] }; case "I_Truck_02_ammo_F": { [1.00, 3.1, 0.57] }; case "I_Truck_02_covered_F": { [1.00, 3.1, 0.57] }; case "I_Truck_02_transport_F": { [1.00, 3.1, 0.57] }; case "B_T_LSV_01_unarmed_F": { [0.72, 2.00, -0.99] }; default { [] }; }; if( _attachExtra1 isEqualTo []) exitWith {}; private _attachExtra2 = switch (typeOf _vehicle) do { case "B_Quadbike_01_F": { [0.30, 1.0, -0.68] }; case "C_Offroad_01_F": { [0.37, 0.00, 0.56] }; case "C_Offroad_02_unarmed_F": { [0.5, 2, -0.61] }; case "C_SUV_01_F": { [-0.49, -1.75, 0.23] }; //Werte für hinten geändert case "B_MRAP_01_F"; case "B_MRAP_01_hmg_F": { [1.00, -2.80, 0.55] }; case "C_Hatchback_01_F"; case "C_Hatchback_01_sport_F": { [0.60, 2.00, -0.95] }; case "I_MRAP_03_F": { [0.37, 0.00, 0.56] }; // << TODO: This cant be true! case "B_Heli_Light_01_F": { [0.37, 0.00, 0.56] }; case "I_Heli_light_03_unarmed_F": { [0.37, 0.00, 0.56] }; case "O_MRAP_02_F": { [0.37, 0.00, 0.56] }; case "B_Truck_01_transport_F": { [1.00, -2.80, 0.55] }; case "C_Van_01_box_F": { [1.00, -0.30, 1.40] }; case "I_Truck_02_ammo_F": { [1.00, 3.1, 0.57] }; case "I_Truck_02_covered_F": { [1.00, 3.1, 0.57] }; case "I_Truck_02_transport_F": { [1.00, 3.1, 0.57] }; case "B_T_LSV_01_unarmed_F": { [0.72, 2.00, -0.99] }; default { [] }; }; if( _attachExtra2 isEqualTo []) exitWith {}; private _left = "#lightpoint" createVehicleLocal (getPos _vehicle); _left lightAttachObject [_vehicle, _attachLeft]; _left setLightColor _colorRight; _left setLightBrightness 0.2; _left setLightAmbient [0.1,0.1,4.5]; _left setLightAttenuation [0.03, 0, 1000, 130]; _left setLightIntensity 10; _left setLightFlareSize 0.38; _left setLightFlareMaxDistance 150; _left setLightUseFlare true; _left setLightDayLight true; private _right = "#lightpoint" createVehicleLocal (getPos _vehicle); _right lightAttachObject [_vehicle, _attachRight]; _right setLightColor _colorRight; _right setLightBrightness 0.2; _right setLightAmbient [0.1,0.1,4.5]; _right setLightAttenuation [0.03, 0, 1000, 130]; _right setLightIntensity 10; _right setLightFlareSize 0.38; _right setLightFlareMaxDistance 150; _right setLightUseFlare true; _right setLightDayLight true; //Hinzufügen der neuen Extralichter private _extra1 = "#lightpoint" createVehicleLocal (getPos _vehicle); _extra1 lightAttachObject [_vehicle, _attachExtra1]; _extra1 setLightColor _colorRight; _extra1 setLightBrightness 0.2; _extra1 setLightAmbient [0.1,0.1,4.5]; _extra1 setLightAttenuation [0.07, 0, 1000, 130]; _extra1 setLightIntensity 10; _extra1 setLightFlareSize 0.38; _extra1 setLightFlareMaxDistance 150; _extra1 setLightUseFlare true; _extra1 setLightDayLight true; private _extra2 = "#lightpoint" createVehicleLocal (getPos _vehicle); _extra2 lightAttachObject [_vehicle, _attachExtra2]; _extra2 setLightColor _colorRight; _extra2 setLightBrightness 0.2; _extra2 setLightAmbient [0.1,0.1,4.5]; _extra2 setLightAttenuation [0.07, 0, 1000, 130]; _extra2 setLightIntensity 10; _extra2 setLightFlareSize 0.38; _extra2 setLightFlareMaxDistance 150; _extra2 setLightUseFlare true; _extra2 setLightDayLight true; hint "Hallo1"; [_vehicle, _attachRight, _attachLeft, _attachExtra1, _attachExtra2, _left, _right, _extra1, _extra2] spawn { params ["_vehicle", "_attachRight", "_attachLeft", "_attachExtra1", "_attachExtra2", "_left", "_right", "_extra1", "_extra2"]; while { alive _vehicle && _vehicle getVariable["lights", false] } do { if( player distance _vehicle < 500 ) then { _brightness = [2, 20] select (sunOrMoon isEqualTo 1); hint "Hey Schleife"; _right setLightBrightness 0; uisleep 0.08; _left setLightBrightness _brightness; uisleep 0.08; _left setLightBrightness 0; uisleep 0.08; _left setLightBrightness _brightness; uisleep 0.08; _left setLightBrightness 0; uisleep 0.08; _right setLightBrightness _brightness; uisleep 0.08; _right setLightBrightness 0; uisleep 0.08; _right setLightBrightness _brightness; uisleep 0.08; } else { uisleep 1; }; }; deleteVehicle _left; deleteVehicle _right; }; //Hinzufügen der Extralichter // DIE SCHLEIFE MAL NACH OBEN SETZEN UM ZU GUCKEN OB ES AN DER SCHLEIFE LIEG; ALSO ERST DIE EXTRAS UND DANN DIE LINKS RECHTS LICHTER AUSFÜHREN [_vehicle, _attachRight, _attachLeft, _attachExtra1, _attachExtra2, _left, _right, _extra1, _extra2] spawn { params ["_vehicle", "_attachRight", "_attachLeft", "_attachExtra1", "_attachExtra2", "_left", "_right", "_extra1", "_extra2"]; while { alive _vehicle && _vehicle getVariable["lights", false] } do { if( player distance _vehicle < 500 ) then { _brightness = [2, 20] select (sunOrMoon isEqualTo 1); _extra1 setLightBrightness 0; uisleep 0.08; _extra2 setLightBrightness _brightness; uisleep 0.08; _extra2 setLightBrightness 0; uisleep 0.08; _extra2 setLightBrightness _brightness; uisleep 0.08; _extra2 setLightBrightness 0; uisleep 0.08; _extra1 setLightBrightness _brightness; uisleep 0.08; _extra1 setLightBrightness 0; uisleep 0.08; _extra1 setLightBrightness _brightness; uisleep 0.08; } else { uisleep 1; }; }; deleteVehicle _extra1; deletevehicle _extra2; }; hint "Hallo Ende";
Code: Funktionelles Original
Alles anzeigen// Written by Kupferkarpfen // License: CC BY-NC-SA 4.0 // No interface, no flashlights... if( !hasInterface ) exitWith {}; private _vehicle = param[0, objNull, [objNull]]; if( isNull _vehicle ) exitWith {}; // Sleep a second to allow syncing, if remoteexec was faster than the variable... uisleep 1; if( !(_vehicle getVariable ["lights", false]) ) exitWith {}; private _side = _vehicle getVariable[ "side", sideUnknown ]; if( _side isEqualTo sideUnknown ) exitWith {}; private _colorLeft = switch( _side ) do { case west: { [20, 0.1, 0.1] }; case independent: { [0.1, 0.1, 20] }; default { [] }; }; private _colorRight = switch( _side ) do { case independent; case west: { [0.1, 0.1, 20] }; default { [] }; }; if( _colorLeft isEqualTo [] || _colorRight isEqualTo [] ) exitWith {}; private _attachLeft = switch (typeOf _vehicle) do { case "B_Quadbike_01_F": { [-0.30, 1.0, -0.68] }; case "C_Offroad_01_F": { [-0.37, 0.00, 0.56] }; case "C_Offroad_02_unarmed_F": { [-0.56, 2, -0.6 ] }; case "C_SUV_01_F": { [-0.37, 2.20, -0.60] }; case "B_MRAP_01_F"; case "B_MRAP_01_hmg_F": { [-1.00, -2.80, 0.55] }; case "C_Hatchback_01_F"; case "C_Hatchback_01_sport_F": { [-0.60, 2.00, -0.95] }; case "I_MRAP_03_F": { [-0.37, 0.00, 0.56] }; // << TODO: This cant be true! case "B_Heli_Light_01_F": { [-0.37, 0.00, 0.56] }; case "I_Heli_light_03_unarmed_F": { [-0.37, 0.00, 0.56] }; case "O_MRAP_02_F": { [-0.37, 0.00, 0.56] }; case "B_Truck_01_transport_F": { [-1.00, -2.80, 0.55] }; case "C_Van_01_box_F": { [-1.00, -0.30, 1.40] }; case "I_Truck_02_ammo_F": { [-1.00, 3.1, 0.57] }; case "I_Truck_02_covered_F": { [-1.00, 3.1, 0.57] }; case "I_Truck_02_transport_F": { [-1.00, 3.1, 0.57] }; case "B_T_LSV_01_unarmed_F": { [-0.72, 2.00, -0.99] }; default { [] }; }; if( _attachLeft isEqualTo []) exitWith {}; private _attachRight = switch (typeOf _vehicle) do { case "B_Quadbike_01_F": { [0.30, 1.0, -0.68] }; case "C_Offroad_01_F": { [0.37, 0.00, 0.56] }; case "C_Offroad_02_unarmed_F": { [0.5, 2, -0.61] }; case "C_SUV_01_F": { [0.37, 2.20, -0.60] }; case "B_MRAP_01_F"; case "B_MRAP_01_hmg_F": { [1.00, -2.80, 0.55] }; case "C_Hatchback_01_F"; case "C_Hatchback_01_sport_F": { [0.60, 2.00, -0.95] }; case "I_MRAP_03_F": { [0.37, 0.00, 0.56] }; // << TODO: This cant be true! case "B_Heli_Light_01_F": { [0.37, 0.00, 0.56] }; case "I_Heli_light_03_unarmed_F": { [0.37, 0.00, 0.56] }; case "O_MRAP_02_F": { [0.37, 0.00, 0.56] }; case "B_Truck_01_transport_F": { [1.00, -2.80, 0.55] }; case "C_Van_01_box_F": { [1.00, -0.30, 1.40] }; case "I_Truck_02_ammo_F": { [1.00, 3.1, 0.57] }; case "I_Truck_02_covered_F": { [1.00, 3.1, 0.57] }; case "I_Truck_02_transport_F": { [1.00, 3.1, 0.57] }; case "B_T_LSV_01_unarmed_F": { [0.72, 2.00, -0.99] }; default { [] }; }; if( _attachRight isEqualTo []) exitWith {}; private _left = "#lightpoint" createVehicleLocal (getPos _vehicle); _left lightAttachObject [_vehicle, _attachLeft]; _left setLightColor _colorLeft; _left setLightBrightness 0.2; _left setLightAmbient _colorLeft; _left setLightAttenuation [0.181, 0, 1000, 130]; _left setLightIntensity 10; _left setLightFlareSize 0.4; _left setLightFlareMaxDistance 150; _left setLightUseFlare true; _left setLightDayLight true; private _right = "#lightpoint" createVehicleLocal (getPos _vehicle); _right lightAttachObject [_vehicle, _attachRight]; _right setLightColor _colorRight; _right setLightBrightness 0.2; _right setLightAmbient _colorRight; _right setLightAttenuation [0.181, 0, 1000, 130]; _right setLightIntensity 10; _right setLightFlareSize 0.4; _right setLightFlareMaxDistance 150; _right setLightUseFlare true; _right setLightDayLight true; while { alive _vehicle && _vehicle getVariable["lights", false] } do { if( player distance _vehicle < 500 ) then { _brightness = [2, 20] select (sunOrMoon isEqualTo 1); _right setLightBrightness 0; uisleep 0.05; _left setLightBrightness _brightness; uisleep 0.3; _left setLightBrightness 0; uisleep 0.05; _right setLightBrightness _brightness; uisleep 0.3; } else { uisleep 5; }; }; deleteVehicle _left; deleteVehicle _right;
-
Hab den Fehler gefunden xD
Einmal mit nem Hotkey während des Codens im TeamSpeak gemuted, ZACK, zwei ** ganz oben am Codeanfang xD.
Ohne die ** läuft alles, danke für deine Hilfe!
-