Jump to content
  • 0

Request for remote messages/in game messages


lwbuk

Question

On my old 1051 server I had a script that posted a random message at a given time interval.

It ran off another file called remote_message.

Ive tried it out on 1061 and cant get it to work. If anyone could have a look, It would be awesome.

I know you can achieve simiar with MOTD, but this script is much better IMO.

remote_message.sqf

Spoiler

fnc_remote_message = {
    private ["_type", "_message", "_player"];
    _type = _this select 0;
    _message = _this select 1;
    if (count _this > 2) then {
        _player = _this select 2;
        if (_player == player) then {
            switch (_type) do {
                case "globalChat": {
                    player globalChat _message;
                };
                case "hint": {
                    hint _message;
                };
                case "titleCut": {
                    titleCut [_message, "PLAIN DOWN", 3];
                };
                case "titleText": {
                    titleText [_message, "PLAIN DOWN"]; titleFadeOut 10;
                };
            };
        };
    } else {
        switch (_type) do {
            case "hint": {
                hint _message;
            };
            case "titleCut": {
                titleCut [_message,"Plain Down",3];
            };
            case "titleText": {
                titleText [_message, "PLAIN DOWN"]; titleFadeOut 10;
            };
        };
    };
};

"customRemoteMessage" addPublicVariableEventHandler {(_this select 1) call fnc_remote_message;};

 

messages.sqf

Spoiler

If(isServer)exitWith{};
waitUntil {!isNil "dayz_animalCheck"};
_chattxt = "<Overpoch server>:";
sleep 35;
systemChat format["%1 %2",_chattxt,"Welcome to my  Overpoch!"];
sleep 55;
for "_i" from 1 to 16 do {
    if !(alive player)exitwith{};
    _randmsg = [
    "Deploy Bike and Mozzie via toolbox, Press U for earplugs, 0 for autorun, Right Shift for Groups and END for debug toggle",
    "Put money in your safe",
    "Id like this script please",
    "blah blah blah",
    "more text here",
    "any message you like here",
    "and another here",
    "please help"
    ] call BIS_fnc_selectRandom;
    systemChat format["%1 %2",_chattxt,_randmsg];
    sleep 600;
};

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

I did try that also but  thinking about it I think I messed up. 

For some reason I called that file through the init ( I think cos on my 1051 the remote msg script was called).  

I then also called the messages file but they never showed. 

Maybe I need to try just Calling the messages file. 

Link to comment
Share on other sites

  • 0
4 hours ago, lwbuk said:

I did try that also but  thinking about it I think I messed up. 

For some reason I called that file through the init ( I think cos on my 1051 the remote msg script was called).  

I then also called the messages file but they never showed. 

Maybe I need to try just Calling the messages file. 

This is how I initialize that version I use: 

https://github.com/oiad/ZSC/blob/master/init.sqf#L141

This is how it is used (server side) I stole this from WAI.

RemoteMessage = ["radio","[RADIO] Interesting text here, Wow! Look at how it sparkles, This is an example."];
publicVariable "RemoteMessage";

 

Link to comment
Share on other sites

  • 0

Would I be right in thinking I need to use your remote_mesage script to get WAI to announce through radio only via the alert noise and small text in bottom left?

Ive set radio announce to true in the WAI config, but its still putting up the annoying white text in the middle of the screen.

I have it working on my 1051 server, but cant recall exactly what I did.

So if I call your file in the init as you have shown, then WAI should use the radio correctly?

Link to comment
Share on other sites

  • 0

Ok, radio mesages for WAI started randomly working mid server session.. weird.

Havent tried the messages yet though

*edit*

messages doesnt work and WAI seems to randomy choose whether it wants to use the radio or not, doesnt seem any logic to it.

Had enough for tonight lol.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...