Black Lagoon fixx thread

Aus Nitradopedia
Wechseln zu: Navigation, Suche
Arma3Epoch header.png

Miete dir jetzt deinen eigenen prepaid ArmA 3 Epoch Server auf nitrado.net

Kopfbedeckung

Falls Brillen und Hüte nur bei den Polizisten und nicht bei den Zivilisten gespeichert werden, gibt es hier die perfekte Lösung:

Einige Änderungen sind in der fn_civSaveGear.sqf nötig. Und zwar fehlen da folgende Zeilen:

if(goggles player != "") then { _items set[count _items, goggles player]; };
if(headgear player != "") then { _items set[count _items, headgear player]; };

Die werden an einer bestimmten Stelle eingetragen. Hier ist der Code einer fn_civSaveGear.sqf:

/*
File: fn_fetchGear.sqf
Author: Bryan "Tonic" Boardwine

Description:
Fetches the players current gear and returns it in the correct formatted array.

Using the FeatchGear of cops
Because tonics balance is crap
*/
private["_primary,_launcher","_handgun","_magazines","_uniform","_vest","_backpack","_items","_primitems",
"_secitems",
"_handgunitems","_uitems","_vitems","_bitems","_headgear","_goggles"];

_primitems = [];
_secitems = [];
_handgunitems = [];
_primary = primaryWeapon player;
_launcher = secondaryWeapon player;
_handgun = handGunWeapon player;
_magazines = [];
_uniform = uniform player;
_vest = vest player;
_backpack = backpack player;
_items = assignedItems player;
if(primaryWeapon player != "") then {_primitems = primaryWeaponItems player;};
if(handgunWeapon player != "") then {_handgunItems = handgunItems player;};
_headgear = headgear player;
_goggles = goggles player;
_uitems = [];
_vitems = [];
_bitems = [];
if(_uniform != "") then {{_uitems set[count _uitems,_x];} foreach (uniformItems player);};
if(_vest != "") then {{_vitems set[count _vitems,_x];} foreach (vestItems player);};
if(_backpack != "") then {{_bitems set[count _bitems,_x];} foreach (backPackItems player);};

////// VERSUCH ZU SPEICHERN /////
if(goggles player != "") then { _items set[count _items, goggles player]; };
if(headgear player != "") then { _items set[count _items, headgear player]; };

if(primaryWeapon player != "") then
{
player selectWeapon (primaryWeapon player);
if(currentMagazine player != "") then
{
_magazines set[count _magazines,currentMagazine player];
};
};

if(secondaryWeapon player != "") then
{
player selectWeapon (secondaryWeapon player);
if(currentMagazine player != "") then
{
_magazines set[count _magazines,currentMagazine player];
};
};

if(handgunWeapon player != "") then
{
player selectWeapon (handgunWeapon player);
if(currentMagazine player != "") then
{
_magazines set[count _magazines,currentMagazine player];
};
};
player selectWeapon (primaryWeapon player);

if(isNil "_handgunItems") then {_handgunItems = ["","",""];};

//using civ format for compatibility issues
//uniform,backpack,goggles,headgear,assigneditems,uitems,bitems, |vest,primary,launcher,handgun,magazines,primitems,secitems,handgunitems,vitems
//[_primary,_launcher,_handgun,_magazines,_uniform,_vest,_backpack,_items,_primitems,
_secitems,_handgunitems,
_uitems,_vitems,_bitems,_headgear,_goggles];

if(life_n_holstered) then
{
//Translate holster gear to civ gear
//_primary,_handgun,_magazines,_uniform,_vest,_backpack,_items,_primitems,_secitems,_handgunitems,
_uitems,_vitems,_bitems,_launcher
_primary = life_n_holster_data select 0;
_handgun = life_n_holster_data select 1;
_magazines = life_n_holster_data select 2;
_uniform = life_n_holster_data select 3;
_vest = life_n_holster_data select 4;
_backpack = life_n_holster_data select 5;
_items = life_n_holster_data select 6;
_primitems = life_n_holster_data select 7;
_secitems = life_n_holster_data select 8;
_handgunItems = life_n_holster_data select 9;
_uitems = life_n_holster_data select 10;
_vitems = life_n_holster_data select 11;
_bItems = life_n_holster_data select 12;
_launcher = life_n_holster_data select 13;
};

civ_gear = [_uniform,_backpack,_goggles,_headgear,_items,_uitems,_bItems,_vest,_primary,_launcher,_handgun,_magazines,
_primitems,
_secitems,_handgunItems,_vitems];


/*
File: fn_civFetchGear.sqf
Author: Bryan "Tonic" Boardwine

Description:
Fetches specific key items from the civilian for a persistent state.
*/
/*private["_ret","_uItems","_bItems"];
_ret = [];

_ret set[count _ret,uniform player];
_ret set[count _ret,backpack player];
_ret set[count _ret,goggles player];
_ret set[count _ret,headgear player];
_ret set[count _ret,assignedItems player];

_uItems = [];
_bItems = [];

if(uniform player != "") then
{
{
_info = [_x] call life_fnc_fetchCfgDetails;
if((_info select 4) in [4096,131072]) then
{
_uItems set[count _uItems,_x];
};
} foreach (uniformItems player);
};

if(backpack player != "") then
{
{
_info = [_x] call life_fnc_fetchCfgDetails;
if((_info select 4) in [4096,131072]) then
{
_uItems set[count _uItems,_x];
};
} foreach (backpackItems player);
};

_ret set[count _ret,_uItems];
_ret set[count _ret,_bItems];

civ_gear = _ret;*/

In Zeile 35-37 wurde es hier im Beispiel eingetragen. Nun werden die Brillen und Hüte nicht nur bei den Polizisten, sondern auch bei den Zivilisten gespeichert. Das funktioniert nach einem Server-Restart und auch wenn man re-connectet.

Wanted+ fix

Um die Wanted+ Funktion (Spieler auf die Wanted-Liste setzen) richtig nutzen zu können, müsst ihr folgendes tun:

function.h:

class Player_Menu
{
file = "core\pmenu";
class wantedadd2 {};
class wanted2 {};
};

Dann erstellt ihr eine 2. sqf.

core\pmenu\fn_wanted2.sqf

private["_unit","_amount"];

ctrlShow[2001,false];
if((lbCurSel 9902) == -1) exitWith {hint "No one was selected!";ctrlShow[2001,true];};
_unit = lbData [9902,lbCurSel 9902];
_unit = call compile format["%1",_unit];
_amount = lbData [9991,lbCurSel 9991];
if(isNil "_unit") exitWith {ctrlShow[2001,true];};
//if(_unit == player) exitWith {ctrlShow[2001,true];};
if(isNull _unit) exitWith {ctrlShow[2001,true];};

[[1,format["%1 wird gesucht.",name _unit,_amount,getPlayerUID _unit]],"life_fnc_broadcast",nil,false] spawn life_fnc_MP;

[[getPlayerUID _unit,name _unit,_amount],"life_fnc_wantedAdd",false,false] spawn life_fnc_MP;

core\pmenu\fn_wantedadd2.sqf

private["_display","_list","_side"];
disableSerialization;
waitUntil {!isNull (findDisplay 9900)};
_display = findDisplay 9900;
_list = _display displayCtrl 9902;

//Purge List
lbClear _list;


{
_side = switch(side _x) do {case west: {"Cop"}; case civilian : {"Civ"}; default {"Unknown"};};
_list lbAdd format["%1 - %2", name _x,_side];
_list lbSetdata [(lbSize _list)-1,str(_x)];
} foreach playableUnits;


_list2 = _display displayCtrl 9991;
lbClear _list2;


//_index = lbAdd [_list2, "Name"];
//lbSetData [_list2, _index, "pfad/zum/bild.paa"];
//lbSetValue [_list2, _index, "pfad/zum/bild.paa"];

_text = "Fahren/Fliegen o. Führerschein $1.000/10.000"; // name and price
_data = "1";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Versuchter Diebstahl Fahrzeugs $1.500";
_data = "2";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];


_text = "Diebstahl Zivilfahrzeugs $5.000-15.000";
_data = "3";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Fahren ohne Licht $500";
_data = "4";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Überhöhte Geschwindigkeit $2.000-10.000";
_data = "5";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Fahren auf der falschen Seite $1";
_data = "6";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Versuchter Diebstahl Polizeifahrzeugs $10.0000";
_data = "7";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Diebstahl von Polizeifahrzeugen $30.000";
_data = "8";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];


_text = "Landen in einer Flugverbotszone $25.000";
_data = "9";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Fahren von illegalen Fahrzeugen $100.000";
_data = "10";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Fahrerflucht nach Unfall $1.000";
_data = "11";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Fahrerflucht vor der Polizei $5.000";
_data = "12";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Überfahren eines anderen Spielers $6.500";
_data = "13";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Illegale Strassensperren $30.000";
_data = "14";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Widerstand gegen die Staatsgewalt $5-20k";
_data = "15";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Nicht befolgen e.pol.Anordnung $1.000";
_data = "16";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Beamtenbeleidigung $5.000";
_data = "17";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Belästigung eines Polizisten $1";
_data = "18";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Betreten der pol.Sperrzone $5000";
_data = "19";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Töten eines Polizisten $75.000";
_data = "20";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Beschuss auf Polizei/Beamte/Eigentum $1";
_data = "21";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Zerstörung von Polizeieigentum $1";
_data = "22";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Drogendelikte $1";
_data = "23";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Waffenbesitz ohne Lizenz $1";
_data = "24";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Mit gez.Waffe durch Stadt $1";
_data = "25";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Besitz einer verbotenen Waffe $1";
_data = "26";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Schusswaffengebrauch innerhalb Städte $1";
_data = "27";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Geiselnahme $0";
_data = "28";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Überfall auf Personen/Fahrzeuge $1";
_data = "29";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Bankraub $1";
_data = "30";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Mord $1";
_data = "31";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Aufstand $1";
_data = "32";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Angriff durch Rebellen $1";
_data = "33";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Angriff/Belagerung von Hauptstädten $1";
_data = "34";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Vers.Landung in einer Flugverbotszone $1";
_data = "35";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Fliegen/Schweben unterhalb 500m ü.Stadt $1";
_data = "36";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Ausbruch aus dem Gefaengnis $1";
_data = "37";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Fliegen ohne Fluglizenz $1";
_data = "38";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

_text = "Dauerhaft störendes Hupen $1";
_data = "39";
_list2 lbAdd format["%1 (%2)",_text,_data];
_list2 lbSetData [(lbSize _list2)-1,_data];

dialog\wantedadd2.hpp

class life_wantedadd2 {
idd = 9900;
name= "life_wantedadd2";
movingEnable = false;
enableSimulation = true;
onLoad = "[] spawn life_fnc_wantedadd2;";

class controlsBackground {
class Life_RscTitleBackground:Life_RscText {
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.7])"};
idc = -1;
x = 0.1;
y = 0.2;
w = 0.8;
h = (1 / 25);
};

class MainBackground:Life_RscText {
colorBackground[] = {0, 0, 0, 0.7};
idc = -1;
x = 0.1;
y = 0.2 + (11 / 250);
w = 0.8;
h = 0.6 - (2 / 250);
};
};

class controls {


class Title : Life_RscTitle {
colorBackground[] = {0, 0, 0, 0};
idc = 2901;
text = "Wanted add";
x = 0.1;
y = 0.2;
w = 0.7;
h = (1 / 25);
};

class PlayerList_Admin : Life_RscListBox 
{
idc = 9902;
text = "";
sizeEx = 0.035;
//colorBackground[] = {0,0,0,0};
onLBSelChanged = "[_this] spawn life_fnc_adminQuery";

x = 0.12; y = 0.25;
w = 0.30; h = 0.4;
};


class RSUCombo_2101: Life_RscListBox
{
idc = 9991;
text = "";
sizeEx = 0.035;
x = 0.42;
y = 0.25;
w = 0.45;
h = 0.4;
// onLBSelChanged="call fnc_Cmb_changed;";
//--- action/function to call when listbox or combobox has been changed

};



class CloseButtonKey : Life_RscButtonMenu {
idc = -1;
text = "Schliessen";
onButtonClick = "closeDialog 0;";
x = -0.06 + (6.25 / 40) + (1 / 250 / (safezoneW / safezoneH));
y = 0.88 - (1 / 25);
w = 0.18;
//w = (6.25 / 40);
h = (1 / 25);
};


class Adminwanted : Life_RscButtonMenu {
idc = -1;
text = "Hinzufuegen";
onButtonClick = "[] call life_fnc_wanted2;";
x = 0.26 + (6.25 / 40) + (1 / 250 / (safezoneW / safezoneH));
y = 0.88 - (1 / 25);
w = 0.18;
//w = (6.25 / 40);
h = (1 / 25);
}; 



};
};

dialog\masterhandler.h

#include "wantedadd2.hpp"

/core/pmenu/fn_p_openMenu

case west: 
{
ctrlShow[2011,false];

//show cop license 
[player] spawn 
{
[_this select 0] spawn life_fnc_copShowLicense;
sleep 2;
hintSilent "";
};

ctrlShow[9800,true];
};

Im Live_Server/Functions/WantedSystem/fn_WantedAdd.sqf

/*
File: fn_wantedAdd.sqf
Author: Bryan "Tonic" Boardwine

Description:
Adds or appends a unit to the wanted list.
*/
private["_uid","_type","_index","_data","_crimes","_val","_customBounty","_name"];
_uid = [_this,0,"",[""]] call BIS_fnc_param;
_name = [_this,1,"",[""]] call BIS_fnc_param;
_type = [_this,2,"",[""]] call BIS_fnc_param;
_customBounty = [_this,3,["Crime", 100]] call BIS_fnc_param;
if(_uid == "" OR _name == "") exitWith {}; //Bad data passed.

//What is the crime?
switch(_type) do
{
case "187V": {_type = ["Fahrlaessige Toetung",6500]};
case "187": {_type = ["Totschlag",8500]};
case "901": {_type = ["JVA ausbruch",4500]};
case "261": {_type = ["Raub",5000]};
case "261A": {_type = ["versuchter Raub",3000]};
case "215": {_type = ["versuchter Autodiebstahl",2000]};
case "213": {_type = ["Verwenden illegaler Sprengstoff",10000]};
case "211": {_type = ["Diebstahl",1000]};
case "207": {_type = ["Entfuehrung",3500]};
case "207A": {_type = ["versuchte Entfuehrung",2000]};
case "487": {_type = ["Grand Theft",1500]};
case "488": {_type = ["Petty Theft",700]};
case "480": {_type = ["Hit and run",1300]};
case "481": {_type = ["Drogenherstellung",1000]};
case "482": {_type = ["Intent to distribute",5000]};
case "483": {_type = ["Drug Trafficking",9500]};
case "488": {_type = ["Klein-Diebstahl",5000]};
case "480": {_type = ["Fahrerflucht",13000]};
case "481": {_type = ["Drogenschmuggel",150000]};
case "482": {_type = ["Drogenhandel",120000]};
case "483": {_type = ["Fahren unter Drogeneinfluss",60000]};

case "1": {_type = ["Fahren/Fliegen o. Fuehrerschein",5000]};
case "2": {_type = ["Versuchter Diebstahl Fahrzeugs",5000]};
case "3": {_type = ["Diebstahl Zivilfahrzeugs",7000]};
case "4": {_type = ["Fahren ohne Licht",1000]};
case "5": {_type = ["Ueberhoehte Geschwindigkeit",1500]};
case "6": {_type = ["Fahren auf der falschen Seite",1200]};
case "7": {_type = ["Ver. Diebstahl Polizeifahrzeugs",10000]};
case "8": {_type = ["Diebstahl von Polizeifahrzeugen",30000]};
case "9": {_type = ["Landen in einer Flugverbotszone",25000]};
case "10": {_type = ["Fahren von illegalen Fahrzeugen",100000]};
case "11": {_type = ["Fahrerflucht",2000]};
case "12": {_type = ["Fahrerflucht vor Polizei",6000]};
case "13": {_type = ["Ueberfahren anderer Spieler",1200]};
case "14": {_type = ["Illegale Strassensperren",30000]};
case "15": {_type = ["Widerstand gegen die Staatsgewalt",15000]};
case "16": {_type = ["Nicht befolgen v. Anordnung",1000]};
case "17": {_type = ["Beamtenbeleidigung",5000]};
case "18": {_type = ["Belaestigung der Polizei",3200]};
case "19": {_type = ["Betreten der pol.Sperrzone",5000]};
case "20": {_type = ["Toeten eines Polizisten",75000]};
case "21": {_type = ["Beschuss auf Polizei/Beamte/Eigentum",10000]};
case "22": {_type = ["Zerstoerung von Polizeieigentum",20000]};
case "23": {_type = ["Drogendelikte",10000]};
case "24": {_type = ["Waffenbesitz ohne Lizenz",10000]};
case "25": {_type = ["Mit gez.Waffe durch Stadt",5000]};
case "26": {_type = ["Besitz einer verbotenen Waffe",10000]};
case "27": {_type = ["Waffengebrauch in Stadt",25000]};
case "28": {_type = ["Geiselnahme",50000]};
case "29": {_type = ["Ueberfall auf Personen/Fahrzeuge",10000]};
case "30": {_type = ["Bankraub",45000]};
case "31": {_type = ["Mord",45000]};
case "32": {_type = ["Aufstand",20000]};
case "33": {_type = ["Angriff durch Rebellen",30000]};
case "34": {_type = ["Angriff/Belagerung von Hauptstaedten",25000]};
case "35": {_type = ["Vers.Landung in einer Flugverbotszone",10000]};
case "36": {_type = ["Fliegen/Schweben unterhalb 500m-Stadt",10000]};
case "37": {_type = ["Ausbruch JVA",45000]};
case "38": {_type = ["Fliegen ohne Fluglizenz",15000]};
case "39": {_type = ["Dauerhaftes Hupen",3000]};

default {_type = [];};
};

///if(count _type == 0) exitWith {}; //Not our information being passed... <== yes and EXIT here ?!
//Is there a custom bounty being sent? Set that as the pricing. Unfortunately it wont be checked!!!! (Don't use drugs, TONIC!)
//if(_customBounty != -1) then {_type set[1,_customBounty];}; 

//no!!!!! allow custom types TONIC smoked sth!
if((count _type) == 0) then
{
_type = _customBounty; //Custom bounty
};

diag_log format["#WANTED ADD: %1 $%2", _type select 0, _type select 1];

//Search the wanted list to make sure they are not on it.
_index = [_uid,life_wanted_list] call fnc_index;

if(_index != -1) then
{
_data = life_wanted_list select _index;
_crimes = _data select 2;
_crimes set[count _crimes,(_type select 0)];
_val = _data select 3;
life_wanted_list set[_index,[_name,_uid,_crimes,(_type select 1) + _val]];
}
else
{
life_wanted_list set[count life_wanted_list,[_name,_uid,[(_type select 0)],(_type select 1)]];
};

und damit ihr den Button ersetzen, der aktuell nicht funktioniert:

dialog/wanted_list.hpp

den alten Button ersetzen durch:

///////////DAS IST DER NEUE Wanted + BUTTON!!!!
class AddButton : Life_RscButtonMenu {
idc = 2406;
text = "Wanted +";
onButtonClick = "createDialog ""life_wantedadd2"";";
x = 0.26 + (6.25 / 40) + (1 / 250 / (safezoneW / safezoneH));
y = 0.8 - (1 / 25);
w = (6.25 / 40);
h = (1 / 25);
};

AdminTool

Folgende Dateien werden dazu benötigt: [1]

Der Aufbau des Ordners ist selbsterklärend.

Die Datei admin_menu.hpp einfach in den dialog Ordner kopieren und ersetzen.

Die 3 Dateien in core/admin einfach in eurem mpmissions Ordner unter core/admin einfügen.

Danach öffnet ihr im dialog Ordner die Datei player_inv.hpp und fügt unter dem letzten Button einen neuen hinzu.

Definiert den Button beispielsweise als Adminbutton1.

Unter Text steht dann entweder euer str Kommando oder ihr tragt einfach als Text "Admin Menü" ein.

In der Zeile onbuttonklick tragt ihr das ein: "createDialog ""life_admin_menu"";";

Die Koordinaten haben wir im Beispiel wie folgt festgelegt: y=0.85

Die Koordinaten w und h sind gleich wie bei den allen anderen

Hier ein Beispiel aus der player_inv.hpp:

#include "player_sys.sqf"

class playerSettings {

	idd = playersys_DIALOG;
	movingEnable = true;
	enableSimulation = true;
	
	class controlsBackground {
	
	class life_RscTitleBackground:life_RscText {
			colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.7])"};
			idc = -1;
			x = 0.1;
			y = 0.2;
			w = 0.8;
			h = (1 / 25);
		};
		
		class MainBackground:life_RscText {
			colorBackground[] = {0, 0, 0, 0.7};
			idc = -1;
			x = 0.1;
			y = 0.2 + (11 / 250);
			w = 0.8;
			h = 0.6 - (22 / 250);
		};
		
		class Title : life_RscTitle {
			colorBackground[] = {0, 0, 0, 0};
			idc = -1;
			text = "$STR_PM_Title";
			x = 0.1;
			y = 0.2;
			w = 0.8;
			h = (1 / 25);
		};
		
		class moneyStatusInfo : Life_RscStructuredText
		{
			idc = 2015;
			sizeEx = 0.020;
			text = "";
			x = 0.105;
			y = 0.30;
			w = 0.3; h = 0.6;
		};
		
		class PlayersName : Title {
			idc = carry_weight;
			style = 1;
			text = "";
		};
	};
	
	class controls {
		
		class itemHeader : Life_RscText
		{
			idc = -1;
			colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
			text = "$STR_PM_cItems";
			sizeEx = 0.04;
			
			x = 0.62; y = 0.26;
			w = 0.275; h = 0.04;
		};
		
		class licenseHeader : Life_RscText
		{
			idc = -1;
			colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
			text = "$STR_PM_Licenses";
			sizeEx = 0.04;
			
			x = 0.336; y = 0.26;
			w = 0.275; h = 0.04;
		};
		
		class moneySHeader : Life_RscText
		{
			idc = -1;
			colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
			text = "$STR_PM_MoneyStats";
			sizeEx = 0.04;
			
			x = 0.11; y = 0.26;
			w = 0.219; h = 0.04;
		};
	
		class itemList : life_RscListBox 
		{
			idc = item_list;
			sizeEx = 0.030;
			
			x = 0.62; y = 0.30;
			w = 0.275; h = 0.3;
		};
		
		class moneyEdit : Life_RscEdit 
		{
			idc = 2018;
			
			text = "1";
			sizeEx = 0.030;
			x = 0.12; y = 0.42;
			w = 0.18; h = 0.03;
		};
		
		class NearPlayers : Life_RscCombo 
		{
			idc = 2022;
		
			x = 0.12; y = 0.46;
			w = 0.18; h = 0.03;
		};
		
		class moneyDrop : Life_RscButtonMenu
		{
			idc = 2001;
			text = "$STR_Global_Give";
			colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
			onButtonClick = "[] call life_fnc_giveMoney";
			sizeEx = 0.025;
			x = 0.135; y = 0.50;
			w = 0.13; h = 0.036;
		};
		
		class itemEdit : Life_RscEdit {
		
		idc = item_edit;
		
		text = "1";
		sizeEx = 0.030;
		x = 0.62; y = 0.61;
		w = 0.275; h = 0.03;
		
		};
		class iNearPlayers : Life_RscCombo
		{
			idc = 2023;
			
			x = 0.62; y = 0.65;
			w = 0.275; h = 0.03;
		};
		/*
		Disabled till it can be redone
		class moneyInput: life_RscCombo {
			
			idc = money_value;
			
			x  = 0.02; y = 0.402;
			w = .1; h = .030;
		};
		*/
		
		class DropButton : life_RscButtonMenu {
			
			idc = 2002;
			text = "$STR_Global_Give";
			colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
			onButtonClick = "[] call life_fnc_giveItem;";
			
			x = 0.765;
			y = 0.70;
			w = (5.25 / 40);
			h = (1 / 25);
			
		};
		
		class UseButton : life_RscButtonMenu {
			
			text = "$STR_Global_Use";
			colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
			onButtonClick = "[] call life_fnc_useItem;";
			
			x = 0.62;
			y = 0.70;
			w = (5.25 / 40);
			h = (1 / 25);
			
		};
		
		class RemoveButton : life_RscButtonMenu {
			
			text = "$STR_Global_Remove";
			colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
			onButtonClick = "[] call life_fnc_removeItem;";
			
			x = 0.475;
			y = 0.70;
			w = (5.25 / 40);
			h = (1 / 25);
			
		};
		/*
		Disabled till it can be redone
		class DropcButton : life_RscButtonMenu {

			text = "Drop Money";
			onButtonClick = "[] execVM 'player_system\money_fnc.sqf'";
			
			x = 0.13; y = 0.4;
			w = 0.135; h = 0.05;
			
		};
		*/
		
		class ButtonClose : life_RscButtonMenu {
			idc = -1;
			//shortcuts[] = {0x00050000 + 2};
			text = "$STR_Global_Close";
			onButtonClick = "closeDialog 0;";
			x = 0.1;
			y = 0.8 - (1 / 25);
			w = (6.25 / 40);
			h = (1 / 25);
		};
		
		class ButtonSettings : life_RscButtonMenu {
			idc = -1;
			text = "$STR_Global_Settings";
			onButtonClick = "[] call life_fnc_settingsMenu;";
			x = 0.1 + (6.25 / 40) + (1 / 250 / (safezoneW / safezoneH));
			y = 0.8 - (1 / 25);
			w = (6.25 / 40);
			h = (1 / 25);
		};
		
		class ButtonMyGang : Life_RscButtonMenu {
			idc = 2011;
			text = "$STR_PM_MyGang";
			onButtonClick = "[] call life_fnc_gangMenu";
			x = 0.1 + (6.25 / 19.8) + (1 / 250 / (safezoneW / safezoneH));
			y = 0.8 - (1 / 25);
			w = (6.25 / 40);
			h = (1 / 25);
		};
		
		class Licenses_Menu : Life_RscControlsGroup
		{
			idc = -1;
			w = 0.28;
			h = 0.38;
			x = 0.34;
			y = 0.30;
			
			class Controls
			{
				class Life_Licenses : Life_RscStructuredText
				{
					idc = 2014;
					sizeEx = 0.020;
					text = "";
					x = 0;
					y = 0;
					w = 0.27; h = 0.65;
				};
			};
		};
		
		class ButtonGangList : Life_RscButtonMenu {
			idc = 2012;
			text = "$STR_PM_WantedList";
			onButtonClick = "[] call life_fnc_wantedMenu";
			x = 0.1 + (6.25 / 19.8) + (1 / 250 / (safezoneW / safezoneH));
			y = 0.8 - (1 / 25);
			w = (6.25 / 40);
			h = (1 / 25);
		};
	
		class ButtonKeys : Life_RscButtonMenu {
			idc = 2013;
			text = "$STR_PM_KeyChain";
			onButtonClick = "createDialog ""Life_key_management"";";
			x = 0.26 + (6.25 / 19.8) + (1 / 250 / (safezoneW / safezoneH));
			y = 0.8 - (1 / 25);
			w = (6.25 / 40);
			h = (1 / 25);
		};
		
		class ButtonCell : Life_RscButtonMenu {
			idc = 2014;
			text = "$STR_PM_CellPhone";
			//onButtonClick = "createDialog ""Life_cell_phone"";";
			onButtonClick = "createDialog ""cellphone_extended"";";
			x = 0.42 + (6.25 / 19.8) + (1 / 250 / (safezoneW / safezoneH));
			y = 0.8 - (1 / 25);
			w = (6.25 / 40);
			h = (1 / 25);
		};
		
		class ButtonAdminMenu : Life_RscButtonMenu {
			idc = 2021;
			text = "$STR_PM_AdminMenu";
			onButtonClick = "createDialog ""life_extended_admin_menu"";";
			x = 0.1 + (6.25 / 40) + (1 / 250 / (safezoneW / safezoneH));
			y = 0.805;
			w = (6.25 / 40);
			h = (1 / 25);
		};
		
		class ButtonSyncData : life_RscButtonMenu {
			idc = -1;
			//shortcuts[] = {0x00050000 + 2};
			text = "$STR_PM_SyncData";
			onButtonClick = "[] call life_fnc_syncData;";
			x = 0.1;
			y = 0.805;
			w = (6.25 / 40);
			h = (1 / 25);
		};
		
		class ButtonPack : Life_RscButtonMenu {
			idc = -1;
			text = "EINPACKEN ...";
			onButtonClick = "[] spawn life_fnc_vitem_openPackDialog;";
			//x = 0.26 + (6.25 / 19.8) + (1 / 250 / (safezoneW / safezoneH));
			x = 0.42 + (6.25 / 19.8) + (1 / 250 / (safezoneW / safezoneH));
			y = 0.805;
			w = (6.25 / 40);
			h = (1 / 25);
		};
		
		class ButtonMarket : Life_RscButtonMenu {
			idc = -1;
			text = "Markt";
			onButtonClick = "[] spawn life_fnc_openMarketView;";
			//x = 0.26 + (6.25 / 19.8) + (1 / 250 / (safezoneW / safezoneH));
			x = 0.26 + (6.25 / 19.8) + (1 / 250 / (safezoneW / safezoneH));
			y = 0.805;
			w = (6.25 / 40);
			h = (1 / 25);
		};
		
		class ButtonPerms : Life_RscButtonMenu {
			idc = -1;
			text = "Gruppen";
			onButtonClick = "[] spawn life_fnc_permManager";
			x = 0.1 + (6.25 / 19.8) + (1 / 250 / (safezoneW / safezoneH));
			y = 0.805;
			w = (6.25 / 40);
			h = (1 / 25);
		};
		//////////////DAS IST DER NEUE ADMIN MENÜ BUTTON!!!!
		class ButtonAdminMenu1 : life_RscButtonMenu {
			idc = -1;
			text = "Admin Menü";
			onButtonClick = "createDialog ""life_admin_menu"";";
			x = 0.1 ;
			y = 0.85;
			w = (6.25 / 40);
			h = (1 / 25);
		};
	};
};

Die admin_menu.hpp sollte so aussehen:

class life_admin_menu {
	idd = 2900;
	name= "life_admin_menu";
	movingEnable = false;
	enableSimulation = true;
	onLoad = "[] spawn life_fnc_adminMenu;";
	
	class controlsBackground {
		class Life_RscTitleBackground:Life_RscText {
			colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.7])"};
			idc = -1;
			x = 0.1;
			y = 0.2;
			w = 0.8;
			h = (1 / 25);
		};
		
		class MainBackground:Life_RscText {
			colorBackground[] = {0, 0, 0, 0.7};
			idc = -1;
			x = 0.1;
			y = 0.2 + (11 / 250);
			w = 0.8;
			h = 0.6 - (2 / 250);
		};
	};
	
	class controls {

		
		class Title : Life_RscTitle {
			colorBackground[] = {0, 0, 0, 0};
			idc = 2901;
			text = "$STR_Admin_Title";
			x = 0.1;
			y = 0.2;
			w = 0.6;
			h = (1 / 25);
		};
		
		class PlayerList_Admin : Life_RscListBox 
		{
			idc = 2902;
			text = "";
			sizeEx = 0.035;
			//colorBackground[] = {0,0,0,0};
			onLBSelChanged = "[_this] spawn life_fnc_adminQuery";
			
			x = 0.12; y = 0.26;
			w = 0.30; h = 0.4;
		};
		
		class PlayerBInfo : Life_RscStructuredText
		{
			idc = 2903;
			text = "";
			x = 0.42;
			y = 0.25;
			w = 0.35;
			h = 0.6;
		};

		class CloseButtonKey : Life_RscButtonMenu {
			idc = -1;
			text = "$STR_Global_Close";
			onButtonClick = "closeDialog 0;";
			x = -0.06 + (6.25 / 40) + (1 / 250 / (safezoneW / safezoneH));
			y = 0.88 - (1 / 25);
			w = (6.25 / 40);
			h = (1 / 25);
		};
		
		class AdminID : Life_RscButtonMenu {
			idc = -1;
			text = "$STR_Admin_GetID";
			onButtonClick = "[] call life_fnc_admingetID;";
			x = 0.1 + (6.25 / 40) + (1 / 250 / (safezoneW / safezoneH));
			y = 0.88 - (1 / 25);
			w = (6.25 / 40);
			h = (1 / 25);
		};
    	
    	
    	class TeleportToHim : Life_RscButtonMenu {
			idc = 2030;
			text = "TP zu ihm";
			onButtonClick = "[] call life_fnc_admintp;";
			x = 0.26 + (6.25 / 40) + (1 / 250 / (safezoneW / safezoneH));
			y = 0.88 - (1 / 25);
			w = (6.25 / 40);
			h = (1 / 25);
		};
    	
    	
    	class MapTeleport : Life_RscButtonMenu {
			idc = 2070;
			text = "TP via Map";
			onButtonClick = "[] spawn life_fnc_admintpmap;closeDialog 0;";
			x = 0.58 + (6.25 / 40) + (1 / 250 / (safezoneW / safezoneH));
			y = 0.88 - (1 / 25);
			w = (6.25 / 40);
			h = (1 / 25);
		};
    	
    		class TeleportToMe : Life_RscButtonMenu {
			idc = 2060;
			text = "TP zu mir";
			onButtonClick = "[] spawn life_fnc_admintptome;";
			x = 0.42 + (6.25 / 40) + (1 / 250 / (safezoneW / safezoneH));
			y = 0.88 - (1 / 25);
			w = (6.25 / 40);
			h = (1 / 25);
		};
	};
};

Stellt sicher, dass in eurer masterhandler.h alles eingefügt ist!

Als nächstes öffnet ihr eure functions.h

unter class admin tragt ihr folgendes ein:

class admintp {};
class admintpmap {};
class admintptome {};

um zu verhindern das andere Spieler, die kein Admin sind, den Admin Menü Button sehen macht ihr folgendes:

ihr öffnet eure player_inv.hpp im dialog Ordner. Scrollt runter zu eurem 2. Admin Menü Button und tragt im Feld "idc=" beispielsweise die ID 3000 ein.

class ButtonAdminMenu1 : life_RscButtonMenu {
			idc = 3000;
			text = "Admin Menü";
			onButtonClick = "createDialog ""life_admin_menu"";";
			x = 0.1 ;
			y = 0.85;
			w = (6.25 / 40);
			h = (1 / 25);
		};
	};
};

Danach öffnet ihr unter core/pmenu die Datei fn_p_openmenu.sqf und tragt darin unter den Zeilen "if(_GETC_(life_adminlevel) < 1) then" das Kommando "ctrlShow[3000,false];" ein.

Die gleiche Prozedur wiederholt ihr in der fn_p_updatemenu.sqf die ebenfalls unter core/pmenu zu finden ist.

Zur Orientierung hier noch 2 Beispiele:

fn_p_opennenu.sqf

#include <macro.h>
/*
	File: fn_p_openMenu.sqf
	Author: Bryan "Tonic" Boardwine
	
	Description:
	Opens the players virtual inventory menu
*/
if(!alive player || dialog) exitWith {}; //Prevent them from opening this for exploits while dead.
createDialog "playerSettings";
disableSerialization;

switch(playerSide) do
{
	case west: 
	{
		ctrlShow[2011,false];
		
		//show cop license		
		[player] spawn 
		{
			[_this select 0] spawn life_fnc_copShowLicense;
			sleep 2;
			hintSilent "";
		};
	};
	
	case civilian:
	{
		if(!license_civ_viewwanted) then
		{
			ctrlShow[2012,false];
		};
	};
};

if(__GETC__(life_adminlevel) < 1) then
{
	ctrlShow[2020,false];
	ctrlShow[2021,false];
	ctrlShow[3000,false];
};

[] call life_fnc_p_updateMenu;

if(__GETC__(life_adminlevel) < 1) then
{
	ctrlShow[2020,false];
	ctrlShow[2021,false];
	ctrlShow[3000,false];
};

fn_p_updatemenu.sqf:

#include <macro.h>
/*
	File: fn_p_updateMenu.sqf
	Author: Bryan "Tonic" Boardwine
	
	Description:
	Updates the player menu (Virtual Interaction Menu)
*/
private["_dialog","_inv","_lic","_licenses","_near","_near_units","_mstatus","_shrt","_side","_isillegal","_ispoliceonly"];
disableSerialization;

if(__GETC__(life_adminlevel) < 1) then
{
	ctrlShow[2020,false];
	ctrlShow[2021,false];
	ctrlShow[3000,false];
};

_side = switch(playerSide) do {case west:{"cop"}; case civilian:{"civ"};};

_dialog = findDisplay 2001;
_inv = _dialog displayCtrl 2005;
_lic = _dialog displayCtrl 2014;
_near = _dialog displayCtrl 2022;
_near_i = _dialog displayCtrl 2023;
_mstatus = _dialog displayCtrl 2015;
_struct = "";
lbClear _inv;
lbClear _near;
lbClear _near_i;

//Near players
_near_units = [];
{ if(player distance _x < 10) then {_near_units set [count _near_units,_x];};} foreach playableUnits;
{
	if(!isNull _x && alive _x && player distance _x < 10 && _x != player) then
	{
		_near lbAdd format["%1 - %2",name _x, side _x];
		_near lbSetData [(lbSize _near)-1,str(_x)];
		_near_i lbAdd format["%1 - %2",name _x, side _x];
		_near_i lbSetData [(lbSize _near)-1,str(_x)];
	};
} foreach _near_units;

_mstatus ctrlSetStructuredText parseText format["<img size='1.3' image='icons\bank.paa'/> <t size='0.8px'>$%1</t><br/><img size='1.2' image='icons\money.paa'/> <t size='0.8'>$%2</t>",[life_atmcash] call life_fnc_numberText,[life_cash] call life_fnc_numberText];
ctrlSetText[2009,format["Weight: %1 / %2", life_carryWeight, life_maxWeight]];

//update items
{
	_str = [_x] call life_fnc_varToStr;
	_shrt = [_x,1] call life_fnc_varHandle;
	_val = missionNameSpace getVariable _x;
	if(_val > 0) then
	{
		_isillegal = _shrt in life_illegal_item_shortnames; //if illegal
    	_ispoliceonly =  _shrt in life_police_only_items;
		
		/*if(playerSide != west && _ispoliceonly) then //if police only => illegal
		{
			_isillegal = true;
		};*/
		
		if(_isillegal) then
		{
			if(_shrt == "illegalmoney") then //trigger for illegal money
			{
				_inv lbAdd format["$%1 (Illegal)",_val];
			}
			else
			{
				_inv lbAdd format["%1x - %2 (Illegal)",_val,_str];
			};
		}
		else
		{
        	if(_ispoliceonly && playerSide != west) then
        	{
             	_inv lbAdd format["%1x - %2 (Polizei)",_val,_str];
        	}
        	else
        	{
            	_inv lbAdd format["%1x - %2",_val,_str];
        	};
		};
		
		_inv lbSetData [(lbSize _inv)-1,_shrt];
	};
} foreach life_inv_items;

//update licenses
{
	if((_x select 1) == _side) then
	{
		_str = [_x select 0] call life_fnc_varToStr;
		_val = missionNamespace getVariable (_x select 0);
		if(_val) then
		{
			_struct = _struct + format["%1<br/>",_str];
		};
	};
} foreach life_licenses;

if(_struct == "") then
{
	_struct = "Keine Lizenzen/Fähigkeiten";
};

_lic ctrlSetStructuredText parseText format["
<t size='0.8px'>
%1
</t>
",_struct];

So sieht das ganze dann im Spiel aus: [2]

Willkommennachricht ändern

core/fn_welcomeNotification.sqf