Ich wollte gerne das Channel 7 auf meinem Server aktivieren. Allerdings habe ich ein kleines Problem. Man kann eine Nachricht eingeben, es wird Geld abgezogen, aber es wird keine Nachricht gesendet. Die [lexicon]Startparameter[/lexicon] -showscripterrors bringt nur die Meldung auf dem Screenshot.
Hier sind meine Dateien:
Bash: fn_broadcast.sqf
/*
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"];};
case 3: {[_msg,(player getVariable["realname",name player])] call life_fnc_AAN;};
};
};
} else {
switch (_type) do
{
case 0: {systemChat _msg;};
case 1: {hint _msg;};
case 2: {titleText[_msg,"PLAIN"];};
case 3: {[_msg,(player getVariable["realname",name player])] call life_fnc_AAN;};
};
};
};
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 3: {[_message,(player getVariable["realname",name player])] call life_fnc_ANN;};
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 3: {[_message,(player getVariable["realname", name player])] call life_fnc_ANN;};
case 5: {hint parseText format["%1", _message]};
};
};
Alles anzeigen
Die channel.hpp:
Bash: channel.hpp
class channel{
idd = 9000;
name= "channel";
movingEnable = false;
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.6;
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.6;
h = 0.6 - (22 / 250);
};
};
class controls {
class Title : Life_RscTitle {
colorBackground[] = {0, 0, 0, 0};
idc = -1;
text = "Chanel 7 News";
x = 0.1;
y = 0.2;
w = 0.6;
h = (1 / 25);
};
class Channel7NewsEditText : Life_RscStructuredText
{
idc = -1;
text = "Nachricht an Alle:";
x = 0.12;
y = 0.4;
w = 0.2;
h = 0.1;
};
class Channel7Edit : Life_RscEdit
{
idc = 9001;
text = "";
sizeEx = 0.04;
x = 0.275;
y = 0.4;
w = 0.4;
h = 0.04;
};
class Channel7Description : Life_RscStructuredText
{
idc = -1;
text = "Diese Nachricht wird an JEDEN gesendet! Du musst sie jedoch bezahlen.";
x = 0.12;
y = 0.5;
w = 0.5;
h = 0.1;
};
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.8 - (1 / 25);
w = (6.25 / 40);
h = (1 / 25);
};
class SendButtonKey : Life_RscButtonMenu {
idc = 9005;
text = "Send";
onButtonClick = "[] call life_fnc_sendChannel; closeDialog 0;";
x = 0.1 + (6.25 / 40) + (1 / 250 / (safezoneW / safezoneH));
y = 0.8 - (1 / 25);
w = (6.25 / 40);
h = (1 / 25);
};
};
};
Alles anzeigen
Bash: fn_sendChannel.sqf
/*
File: fn_sendChannel.sqf
Author: alleskapot & Lifted
Thanks again for all the help alleskapot!
Description:
Ermöglicht senden bzw. die Abfrage des Geschriebenen.
*/
private["_message"];
disableSerialization;
waitUntil {!isnull (findDisplay 9000)};
if (life_cash < 6000 ) exitWith { systemChat "Du brauchst 60000€ um eine Nachricht zu senden!"; };
//if (playerSide != civilian ) exitWith { systemChat "Du musst ein Zivilist sein!"; };
life_cash = life_cash - 6000;
_message = ctrlText 9001;
[[3,format ["%1 sendete folgende Nachricht von Chanel 7 News an Alle: %2",name player,_message]],"life_fnc_broadcast",true,false] call life_fnc_MP;
life_channel_send = false;
[] spawn
{
sleep 600;
life_channel_send = true;
};
Alles anzeigen
Bash: fn_calldialog.sqf
/*
File: fn_calldialog.sqf
Author: alleskapot & Lifted
Thanks again for all the help alleskapot!
Description:
Calls the Dialog.
*/
if(!createDialog "channel") exitWith {hint "Fehler beim Dialog erstelle";}; //Couldn't create the menu?
disableSerialization;
Bash: fn_AAN.sqf
/*
Author: alleskapot
Description: Sends AAN News to the player
*/
private["_display","_message","_name"];
disableSerialization;
_message = _this select 0;
_name = _this select 1;
[parseText format["<t size='2'>Chanel 7 News - Nachricht von: %1</t>",_name],parseText format["<t size='1.2'>%1 - %1 - %1</t>",_message]] spawn BIS_fnc_AAN;
sleep 30;
_display = uinamespace getvariable "BIS_AAN";
_display closeDisplay 0;
Alles anzeigen
Hat da vielleicht jemand ne Idee, ob sich da irgendwas geändert hat zu Altis Life 3.1.4.8, denn da lief das ganze genau so.