Sign in to follow this  
Followers 0
cGs! mIKE

[SOLVED] [Request] Server Messages on Intervals (implemented into infiSTAR now)

15 posts in this topic

Hello Infistar,

My request would be a way to enter server messages to displayed at a certain time or interval throughout the time the server is up and running.   I 100% know and understand BEC already does this,  but a good chunk of servers do not want to run BEC as it seems outdated (yes I know it still works).  

I noticed you already have the auto-reply function in place which tells me you have a good understanding of the chat/message system,  along with already server restart messages.  

maybe  "first time it is run", "what intervals to be repeated",  "message to be sent"

["5","30", "this server is brought to you by..."],  
["8","15", "This server is protected by infistar..."],  
["7","45", "join us on teamspeak @..."],  

just an idea,  I know I would love the hell out of and not force me to run BEC for this function.

regards,

 

 

1 person likes this

Share this post


Link to post
Share on other sites

Posted (edited)

 

//Message

true spawn { while{_this}do{
systemChat " Restart every 4 hours.";
uisleep 600; //10min


systemChat " Hakuna Matata.";
uisleep 600; //10min

}};

Paste in Init.sqf

You can change systemChat to hint or what else ^^

Edited by [HG]RaVeN103

Share this post


Link to post
Share on other sites
Advertisement
On 3/30/2016 at 7:48 PM, Sjolie said:

["5","30", "this server is brought to you by..."],  
["8","15", "This server is protected by infistar..."],  
["7","45", "join us on teamspeak @..."],  

Do you want the numbers to be in minutes?
 

On 3/30/2016 at 8:15 PM, [HG]RaVeN103 said:

//Message

true spawn { while{_this}do{
systemChat " Restart every 4 hours.";
uisleep 600; //10min


systemChat " Hakuna Matata.";
uisleep 600; //10min

}};

Paste in Init.sqf

You can change systemChat to hint or what else ^^

I really don't want to sound offending but doing it like that is really not a good way, especially with this function you give it way to much "focus" as each "spawn" is treated the same way and I don't think you want this to get as much attention as the exile main loop :P especially thinking of the potatoes some people use to play Arma on.

I mean for me and you it might not have any effect on the gameplay but there really is some people that call things computer which we wouldn't identify as that ^^

 

so on exile you can simply do that if you want to do it like Raven:
[600, {systemChat 'waited 600 seconds which is 10 minutes..';}, [], false] call ExileClient_system_thread_addtask;

but I will add it more beautiful once I got your response Sjolie :)

 

----------

 

this is obsolete now because I implemented it into infiSTAR :)

 

 

 

1 person likes this

Share this post


Link to post
Share on other sites

I like the idea of this and would be interested myself.

Will they pop as chat messages or exile messages? I feel like chat gets ignored to much haha.

 

Minutes would be preferred :P

Share this post


Link to post
Share on other sites

for as long as I don't release the next patch you can put it somewhat like this into your mpmission

 

/*
	by infiSTAR.de
	time in minutes
	[first occurrence after x min, show again after x min, text]
*/
NOTIFY_MSG_ARRAY = [
	[5, 30, 'This is a nice server'],  
	[8, 1, 'infiSTAR rules'],  
	[7, 45, 'yay \m/'],
	[15, 15, '15 minutes have passed, drink some water! (IRL NOT INGAME YOU PLEB)']
];

/* do not touch below */
{_x set [0,(_x select 0)*60];_x set [1,(_x select 1)*60];} forEach NOTIFY_MSG_ARRAY;
LAST_NOTIFICATION_SHOWN = 0;
_code = {
	{
		if(time > LAST_NOTIFICATION_SHOWN)then
		{
			ctrlDelete ((findDisplay 46) displayCtrl 117997);
			
			_timetostart = _x select 0;
			if(time > _timetostart)then
			{
				_selection = _x;
				_cooldown = _x select 1;
				_selection set [0,time + _cooldown];
				NOTIFY_MSG_ARRAY set [_forEachIndex,_selection];
				
				LAST_NOTIFICATION_SHOWN = time + 4;
				ctrlDelete ((findDisplay 46) displayCtrl 117997);
				_ctrl = (findDisplay 46) ctrlCreate['RscStructuredText', 117997];
				_ctrl ctrlSetPosition [safeZoneX + 0.1,SafeZoneY + 1,1,1];
				_ctrl ctrlSetScale 2;
				_ctrl ctrlCommit 0;
				_ctrl ctrlSetStructuredText parseText format['<t color=''#ff0000'' size=''0.6'' align = ''left'' font =''OrbitronMedium''>%1</t>',_x select 2];
				
				systemChat (_x select 2);
			};
		};
	} forEach NOTIFY_MSG_ARRAY;
};
msgthreadid = [0.5, _code, [], true] call ExileClient_system_thread_addtask;

 

----

 

this is obsolete now because I implemented it into infiSTAR :)

 

 

 

 

3 people like this

Share this post


Link to post
Share on other sites

I was thinking minutes since that seems to be the go-to system for all configs most server owners are working with.  A small explanation on top of the file is perfect how you wrote it,  I think anyone would understand those instructions:

/*
	by infiSTAR.de
	time in minutes
	[first occurrence after x min, show again after x min, text]
*/

 

I think that is self explanatory, and works great.    I'll throw this in our mission file,  I appreciate you writing this up.    I think others will appreciate it as it completes the infistar even further as the "all-in-one" package all server owners need.   I see a lot of people post about "server notifications" and "server messages",  which you already nailed down.    

Again,  amazing work on infistar,  love it. 

-Mike

Share this post


Link to post
Share on other sites

I put it in a .sqf, and called from init,  but it didn't want to pull up/work.  should I do it in a different format? 

Share this post


Link to post
Share on other sites

It might be that the exile system on the client wasn't fully loaded when this tries to init, if you start it from the init.sqf you can have it like

Spoiler

/*
	by infiSTAR.de
	time in minutes
	[first occurrence after x min, show again after x min, text]
*/
NOTIFY_MSG_ARRAY = [
	[5, 30, 'This is a nice server'],  
	[8, 1, 'infiSTAR rules'],  
	[7, 45, 'yay \m/'],
	[15, 15, '15 minutes have passed, drink some water! (IRL NOT INGAME YOU PLEB)']
];

/* do not touch below */
[] spawn {
	waitUntil {!isNil 'ExileSystemThreadSleep'};
	{_x set [0,(_x select 0)*60];_x set [1,(_x select 1)*60];} forEach NOTIFY_MSG_ARRAY;
	LAST_NOTIFICATION_SHOWN = 0;
	_code = {
		{
			if(time > LAST_NOTIFICATION_SHOWN)then
			{
				ctrlDelete ((findDisplay 46) displayCtrl 117997);
				
				_timetostart = _x select 0;
				if(time > _timetostart)then
				{
					_selection = _x;
					_cooldown = _x select 1;
					_selection set [0,time + _cooldown];
					NOTIFY_MSG_ARRAY set [_forEachIndex,_selection];
					
					LAST_NOTIFICATION_SHOWN = time + 4;
					ctrlDelete ((findDisplay 46) displayCtrl 117997);
					_ctrl = (findDisplay 46) ctrlCreate['RscStructuredText', 117997];
					_ctrl ctrlSetPosition [safeZoneX + 0.1,SafeZoneY + 1,1,1];
					_ctrl ctrlSetScale 2;
					_ctrl ctrlCommit 0;
					_ctrl ctrlSetStructuredText parseText format['<t color=''#ff0000'' size=''0.6'' align = ''left'' font =''OrbitronMedium''>%1</t>',_x select 2];
					
					systemChat (_x select 2);
				};
			};
		} forEach NOTIFY_MSG_ARRAY;
	};
	msgthreadid = [0.5, _code, [], true] call ExileClient_system_thread_addtask;
};

 

this instead. The extra "spawn" thread with the waituntil will end as soon as the client is done loading the preInit so it is no persistent extra thread :)

2 people like this

Share this post


Link to post
Share on other sites
Advertisement
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.