Jump to content

Release: Local Server Messages


Cherdenko

Recommended Posts

puts out pre-defined server messages in a random order
 

Spoiler

 

needs to be called with


execVM "YOUR\PATH\msg.sqf";

in the


if (!isDedicated) then {

Section

safe the folowing as msg.sqf


//rewritten by Cherdenko

if(isServer)exitWith{};
//waitUntil {!isNull (findDisplay 46)}; // Makes the script start when player is ingame
waitUntil {scriptDone progress_monitor};

//this is the text before the message "" for nothing
_chattxt = "[YOUR SERVERNAME HERE]: ";

//init sleep to let the player spawn in and start playing, before we send the first message
sleep 25;

//Send an initial message
systemChat format["%1 %2",_chattxt,"Welcome to [YOUR SERVER HERE]"]; // this is the first message it send
sleep 25;
//Send the messages
for "_i" from 1 to 4 do { // steps need to equal lines
	//if player dies, we exit the scope ending the script
	if !(alive player)exitwith{};
	_randmsg = [
/* messages here within "", */	
	"Put",
	"your",
	"messages",
	"here"   //last entry does not get a comma (,) at the end or script will fail
	] call BIS_fnc_selectRandom;
	systemChat format["%1 %2",_chattxt,_randmsg];
	sleep 600; // change to anytime you want to, to reduce the delay or make it higher !in seconds!
};

 

and you are good to go

Link to comment
Share on other sites

  • 4 months later...

@nova

For example: If u put the msg.sqf into Your Server Root/Mpmissions\Your instance\msg\

then  open your init.sqf and find:

execFSM "\z\addons\dayz_code\system\player_monitor.fsm";

just below paste:

execVM "msg\msg.sqf";

*NOTE: if u wanna use dynamicText function then into msg.sqf

//find:

systemChat format["%1 %2",_chattxt,_randmsg];

//change by:

[format["<t size='0.5' color='#D01000'>%1</t><br/><t size='0.5'>%2</t>",_chattxt,_randmsg],0,0,2,2] spawn BIS_fnc_dynamicText;	

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 

Another way to make something similar, without externals scripts is using the motd line located in your : serverRoot\your instance\ config.cfg

this line:

motd[] = {"DayZ Epoch","Have fun!"};
motdInterval = 0;

then change this line by:

motd[] = {
"My first Msg",
"My second Msg",
"My 3 Msg",
"My 4 Msg"//last line without ","
};
motdInterval = 120;//time in seconds between each msg.

 

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...