Ja hallo erst einmal, da ich momentan nicht mehr viel mit Arma und zu tun habe möchte ich euch hier was geben: cookie
#Schritt Uno:
Erstellt die Datei fn_message.sqf im core\functions Ordner mit folgendem Inhalt:
/*
* Author: Crunch
* Description: New Message System for Altis Life with Emojis --> Basiert natürlich null auf das von D100 #kappaKlaus
*/
params[
"_text",
["_speed","",[""]],
["_color","default",["default"]]
];
//if (isServer || !hasInterface) exitWith {};
disableSerialization;
_display = finddisplay 46;
playSound "HintExpand";
_config = missionConfigFile >> "cfgMsg";
_cfgColor = getArray(_config >> "msgColors" >> _color >> "rgbt");
_cfgSleep = getNumber(_config >> "msgTime" >> _speed >> "time");
_emo_list = getArray(_config >> "msgSmiley" >> "smileys");
_emo_enabled = getNumber(_config >> "msgSmiley" >> "senabled");
if (_text isEqualType "") then {
if(_emo_enabled isEqualTo 1) then {
{
_emo = [_x select 0,_text] call BIS_fnc_inString;
if (_emo) then {
_text=[_text,_x select 0,_x select 1] call KRON_Replace;
};
}forEach _emo_list;
};
_text = parseText _text;
};
private _Header = _display ctrlCreate ["RscText", -1];
_Header ctrlSetPosition [0 * safezoneW + safezoneX, 0.21 * safezoneH + safezoneY, 0.005 * safezoneW, 0.011 * safezoneH];
_Header ctrlSetBackgroundColor _cfgColor;
_Header ctrlSetFade 1;
_Header ctrlCommit 0;
_Header ctrlSetFade 0;
_Header ctrlCommit 0.4;
private _TextField = _display ctrlCreate ["RscStructuredText", -1];
_TextField ctrlSetStructuredText _text;
_TextField ctrlSetPosition [0.005 * safezoneW + safezoneX, 0.021 * safezoneH + safezoneY,0.2 * safezoneW, 0.5];
_TextField ctrlCommit 0;
_TextField ctrlSetPosition [0.005 * safezoneW + safezoneX, 0.2 * safezoneH + safezoneY,0.2 * safezoneW, ((ctrlTextHeight _TextField)+ (0.005 * safezoneH))];
_TextField ctrlSetBackgroundColor [0,0,0,0.75];
_TextField ctrlSetFade 1;
_TextField ctrlCommit 0;
_TextField ctrlSetFade 0;
_TextField ctrlCommit 0.4;
_Header ctrlSetPosition [0 * safezoneW + safezoneX, 0.2 * safezoneH + safezoneY,0.005 * safezoneW, ((ctrlTextHeight _TextField)+ (0.005 * safezoneH))];
_Header ctrlCommit 0;
[_TextField,_Header,_speed,_cfgSleep] spawn {
disableSerialization;
uisleep (_this select 3);
private _TextField = _this select 0;
private _Header = _this select 1;
_TextField ctrlSetFade 1;
_TextField ctrlCommit 0.3;
_Header ctrlSetFade 1;
_Header ctrlCommit 0.3;
uiSleep 0.3;
ctrlDelete _Header;
ctrlDelete _TextField;
};
private _posText = (ctrlPosition (_TextField)) select 1;
private _posHeader = (ctrlPosition (_Header)) select 1;
private _textHigh = (ctrlPosition (_TextField)) select 3;
if (count life_hints > 0) then {
private _activeNotifications = 0;
{
private _ctrlHeader = _x select 0;
private _ctrlText = _x select 1;
if (!isNull _ctrlHeader && !isNull _ctrlText) then {
_ctrlHeader ctrlSetPosition [0 * safezoneW + safezoneX, (_posHeader + _textHigh + 1.5*(0.011 * safezoneH))];
_ctrlText ctrlSetPosition [0.005 * safezoneW + safezoneX, (_posText + _textHigh + 1.5*(0.011 * safezoneH))];
_ctrlHeader ctrlCommit 0.25;
_ctrlText ctrlCommit 0.25;
_posText = (_posText + _textHigh + 1.5*(0.011 * safezoneH));
_posHeader = (_posHeader + _textHigh + 1.5*(0.011 * safezoneH));
_textHigh = (ctrlPosition (_ctrlText)) select 3;
if (_activeNotifications > 3) then {
_ctrlText ctrlSetFade 1;
_ctrlHeader ctrlSetFade 1;
_ctrlText ctrlCommit 0.2;
_ctrlHeader ctrlCommit 0.2;
};
_activeNotifications = _activeNotifications + 1;
};
} forEach life_hints;
};
life_hints = ([[_Header,_TextField]] + life_hints) select {!isNull (_x select 0) && !isNull (_x select 1)};
Alles anzeigen
#Schritt dos:
Geht in eure core\configuration.sqf hinein und fügt unter Backend Variables folgendes ein:
#Schritt tres:
Erstellt eine Config_Message.hpp mit folgendem Inhalt in euren config Ordner:
/*
Author: Crunch
Description: Config für das Neue MSG-System und so
*/
class cfgMsg {
class msgTime { //Regelt wie lange die Nachricht da stehen soll in Sekunden
class fast {time=5;};
class slow {time=15;};
class msg {time=45;};
};
class msgColors { //Regelt die Farben vom Header im RGBT style
class default {rgbt[]={255,137,0,.9};};
class red {rgbt[]={255,0,0,.9};};
class green {rgbt[]={0,255,0,.9};};
class blue {rgbt[]={0,0,255,.9};};
};
class msgSmiley {
senabled = 1;
smileys[] = { //Example: ["CODE","PFAD ZUM BILD","NAME"];
{":angry:","<img size='.6' image='icons\em_angry.paa'/>","Sauer"},
{":cool:","<img size='.6' image='icons\em_cool.paa'/>","Cool"},
{":cry:","<img size='.6' image='icons\em_cry.paa'/>","Häulen"},
{":D","<img size='.6' image='icons\em_dd.paa'/>","Lachkick"},
{":evil:","<img size='.6' image='icons\em_devil.paa'/>","Täufel"},
{"<33","<img size='.6' image='icons\em_dh.paa'/>","Doppel Herz"},
{":(","<img size='.6' image='icons\em_dk.paa'/>","Traurig"},
{":nlike:","<img size='.6' image='icons\em_dlike.paa'/>","Gefällt mir nicht"},
{":gamer:","<img size='.6' image='icons\em_gamer.paa'/>","Gamer"},
{":ghost:","<img size='.6' image='icons\em_ghost.paa'/>","Geist"},
{"<3","<img size='.6' image='icons\em_heart.paa'/>","Herz"},
{"*D","<img size='.6' image='icons\em_heye.paa'/>","Liebe"},
{":*","<img size='.6' image='icons\em_kiss.paa'/>","Kuss"},
{":like:","<img size='.6' image='icons\em_like.paa'/>","Like"},
{":nerd:","<img size='.6' image='icons\em_nerd.paa'/>","Nerd"},
{":nintre:","<img size='.6' image='icons\em_nintrest.paa'/>","Nicht Interessiert"},
{":pedo:","<img size='.6' image='icons\em_pedo.paa'/>","Pedo"},
{":rock:","<img size='.6' image='icons\em_rock.paa'/>","Rockenroll"},
{":shity:","<img size='.6' image='icons\em_shit.paa'/>","Shitty"},
{"xD","<img size='.6' image='icons\em_xd.paa'/>","Lachflash"},
{"xP","<img size='.6' image='icons\em_xp.paa'/>","Freaky"},
{":kappa:","<img size='.7' image='icons\em_kappa.paa'/>","Kappa"},
{":lol:","<img size='.7' image='icons\em_lol.paa'/>","LOL"}
};
};
};
Alles anzeigen
#Schritt cuatro:
Geht in eure description.ext und fügt dort folgendes ein:
#Schritt cinco:
Fügt nun zu guter Letzt noch den icons Ordner vom Anhang in eure Mission
#Schritt seis
Geht in eure Functions.hpp und fügt in der class Functions folgendes ein:
Anwendung:
Wie ihr den Dreck jetzt genau benutzt ist simpel
["ZUERST DIE NACHRICHT","ANZEIGE ZEIT [SLOW,FAST,MSG]","DIE FARBE"] spawn life_fnc_message;
bsp:
["MAN IST DIESES SCRIPT COOL UND GARNICHT BASIEREND VON D100 UND SO KAPPA","fast","red"] spawn life_fnc_message;
Wer dieses System für das Nachrichtensystem verwenden möchte, muss nur in die functinos.sqf in seiner life_server.pbo gehen und z.B.:
hint parseText format [""<t color='#FFCC00'><t size='2'><t align='center'>New Message<br/><br/><t color='#33CC33'><t align='left'><t size='1'>To: <t color='#ffffff'>You<br/><t color='#33CC33'>From: <t color='#ffffff'>%1<br/><br/><t color='#33CC33'>Message:<br/><t color='#ffffff'>%2"",_from,_msg];
durch
[format [""<t color='#FFCC00'><t size='2'><t align='center'>Neue SMS<br/><br/><t color='#33CC33'><t align='left'><t size='1'>Zu: <t color='#ffffff'>Dir<br/><t color='#33CC33'>Von: <t color='#ffffff'>%1<br/><br/><t color='#33CC33'>Inhalt:<br/><t color='#ffffff'>%2"",_from,_msg],""MSG"",""DEFAULT""];
ersetzen.
So zum Schluss wer es nicht gemerkt hat, ja das Nachrichtensystem basiert auf das von D100, da mir aber ein paar Dinge daran nicht gefallen haben, musste ich das ja ändern