Hallo zusammen,
heute möchte ich hier ein weiteres Tutorial machen. Dieses Script ist nicht von mir geschrieben, ich verbreite es nur für die Deutsche Community
Das Originalscipt von "Warnerm14" findet Ihr hier: altisliferpg.com
<▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬> E R K L Ä R U N G <▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬>
Mit diesem Script könnt Ihr, egal ob als Polizist, ADAC, Sanitäter oder sonstiges, mobile Checkpoint oder Absperrungen erstellen.
Hier ein YouTube Video wie es aussieht
Dieses Script funktioniert derzeit für die Versionen 4.0 - 4.4
<▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬> I N S T A L L A T I O N <▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬>
Zu aller erst erstellen wir in Altis_Life.Altis/core/actions die Datei fn_barriers.sqf mit folgendem Inhalt:
/*
File: fn_barrier.sqf
Author: Warnerm14
Desc: Everytime this is ran, it will open the menu.
*/
//Incase you run the menu again, this removes the old entrys so it doesnt double.
player removeAction placebargate;
player removeAction placebarrier;
player removeAction placecone;
player removeAction dropitem;
player removeAction remove;
player removeaction cancelBarrier;
player removeAction headerBarrier;
//The header so make the list stand out.
headerBarrier = player addaction [("<t color=""#FF3300"">" + ("### BARRIERS ###") +"</t>"),""];
//Bargate Action
placebargate = player addaction [("<t color=""#00ced1"">" + ("Place Bargate") +"</t>"),{ //Defines what you see on the menu.
detach placeable; //If you try to place another item while holding an object it will drop the first item.
placeable setVectorUP (surfaceNormal [(getPosATL placeable) select 0,(getPosATL placeable) select 1]); //Makes it level with terrain.
placeable = "Land_BarGate_F" createVehicle position player; //Spawns the object ontop of the player.
placeable attachTo [player, [0, 5, 4]]; //Attaches to the player and allows them to move it around.
//placeable allowdamage false; //Remove the // infront of placeable to make the bargate indestructable.
}];
placebarrier = player addaction [("<t color=""#00ced1"">" + ("Place Barrier") +"</t>"),{ //SAME AS THE TOP
detach placeable;
placeable setVectorUP (surfaceNormal [(getPosATL placeable) select 0,(getPosATL placeable) select 1]);
placeable = "Land_CncBarrier_F" createVehicle position player;
placeable attachTo [player, [0, 3, 0.4]];
}];
placecone = player addaction [("<t color=""#00ced1"">" + ("Place Cone") +"</t>"),{ //SAME AS THE TOP
detach placeable;
placeable setVectorUP (surfaceNormal [(getPosATL placeable) select 0,(getPosATL placeable) select 1]);
placeable = "RoadCone_L_F" createVehicle position player;
placeable attachTo [player, [0, 2, 0.4]];
}];
dropitem = player addaction [("<t color=""#00ced1"">" + ("Drop") +"</t>"),{ //The drop item entry.
detach placeable; //Detaches the object from the player.
placeable setVectorUP (surfaceNormal [(getPosATL placeable) select 0,(getPosATL placeable) select 1]); //Makes it level with the ground.
placeable = apple; //Clears the varible to prevent bugs.
}];
remove = player addaction [("<t color=""#00ced1"">" + ("Remove") +"</t>"),{ //The remove item entry.
_barrier = position player nearObjects ["Land_CncBarrier_F", 2]; //Detects concrete barriers within 2 meters.
_cone = position player nearObjects ["RoadCone_L_F", 1]; //Detects cones within 1 meters.
_bargate = position player nearObjects ["Land_BarGate_F", 4]; //Detects bargates within 4 meters.
_remove = (_barrier select 0); //Selects barrier
deleteVehicle _remove; //Deletes barrier
_remove1 = (_cone select 0); //Selects cone
deleteVehicle _remove1; //Deletes cone
_remove2 = (_bargate select 0); //Selects bargate
deleteVehicle _remove2; //Deletes bargate
barrier = apple;
}];
// When ran this entry will remove all the barrier options from the action menu.
cancelBarrier = player addaction [("<t color=""#FF3300"">" + ("### Close ###") +"</t>"),{
player removeAction placebargate;
player removeAction placebarrier;
player removeAction placecone;
player removeAction dropitem;
player removeAction remove;
player removeaction cancelBarrier;
player removeAction headerBarrier;
placeable = apple;
}];
Alles anzeigen
Wenn wir die Datei erstellt haben, dann öffnen wir die function.h bzw. die functions.hpp und fügen unter dem Punkt
class Actions folgendes ein:
Nachdem wir dies dort eingefügt haben, müssen wir nur noch in die fn_setupActions.sqf und dort in die gewünschte Fraktion
folgendes einfügen:
//Warner's barriers
life_actions = life_actions + [player addAction ["Barriere",life_fnc_barriers]];
So das war es , nun habt Ihr noch alternativ die Möglichkeit im Spiel über die Debug Console das Menü zu öffnen, dazu einfach
nur folgendes ausführen:
<▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬> C O N F I G U R A T I O N <▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬>
Um nun noch die Farben, bzw. den Text zu ändern müsst Ihr ausschließlich in die fn_barriers.sqf und dort folgende Zeilen beachten
player addaction [("<t color=""#FF3300"">" + ("### Close ###") +"</t>")
Die Farbe könnt Ihr ändern indem Ihr die HTML Farbcodes benutzt
HIER KÖNNT IHR DIE RAUSFINDEN
Der Text lässt sich ändern indem Ihr ("### Close ###") nach eurem Wunsch ändert.
##EDIT
Wenn Ihr z.B. die Schranken nicht entfernen könnt, stellt einfach die 4 bei folgendem Code um:
Zeile 44 bei fn_barrier.sqf
_bargate = position player nearObjects ["Land_BarGate_F", 4]
Die 4 steht hier für die Meter die man entfernt sein muss.
(Ich habe es bei mir z.B. auf 10 Meter gestellt, dann geht alles ohne Probleme)
<▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬> E N D E <▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬>
So Ich hoffe das es euch geholfen hat, Viel Spaß damit