Jump to content
  • 0

[help]Timed messages to everyone


ALKINDA

Question

Hello,

 

I am trying to make a script that will display a message to every online client at once, multiple times.

 

what I tried was this script:

 
//servermsg.sqf
while {true} do
{
sleep (60*5); //Wait 5 minutes
    player globalChat "Welcome to ";
sleep 3300;
player globalChat "Server Will Restart In 3 Hours";
sleep 3600;
player globalChat "Server Will Restart In 2 Hours", "PLAIN DOWN";
sleep 3600;
player globalChat "Server Will Restart In 1 Hours", "PLAIN DOWN";
sleep 1800;
player globalChat "Server Will Restart In 30 Minutes", "PLAIN DOWN";
sleep 900;
player globalChat "Server Will Restart In 15 Minutes", "PLAIN DOWN";
sleep 300;
player globalChat "Server Will Restart In 10 Minutes", "PLAIN DOWN";
sleep 300;
player globalChat "Server Will Restart In 5 Minutes", "PLAIN DOWN";
sleep 60;
player globalChat "Server Will Restart In 4 Minutes", "PLAIN DOWN";
sleep 60;
player globalChat "Server Will Restart In 3 Minutes", "PLAIN DOWN";
sleep 60;
player globalChat "Server Will Restart In 2 Minutes", "PLAIN DOWN";
sleep 60;
player globalChat "Server Will Restart In 1 Minutes", "PLAIN DOWN";
sleep 30;
player globalChat "Server Will Restart In 30 Seconds", "PLAIN DOWN";
};  
 

 
//init.sqf snippet of isServer
 
if (isServer) then {
...
...
...
_nil = [] execVM "custom\servermsg\servermsg.sqf";
 
};
 


I have also tried inside my init at the bottom:

 

 
execVM "custom\servermsg\servermsg.sqf";
 

 

 

Can anyone tell me what im doing wrong, because it will not post any messages.

 

Thanks for your time. 

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

player globalChat is local and will not be displayed in RCON

 

Have you tested it in game?

 

Also using Sleep is not the best option. It will cause massive lag on your server.

 

ok im just going by what a forum told me about this, http://forums.bistudio.com/showthread.php?96308-How-can-I-display-a-server-message-to-all-players

 

Yes i have tested with nothing. so thats basically why im here :D

 

 

Is there a better way to do this that wont cause the sleep lag?

Link to comment
Share on other sites

  • 0

That's pretty funny since all the other hosts use it without a problem. Time to find us a new host.

 

I totally agree, out of the 5 or so hosts i have been with, this has got to be the most infuriating thing to not have. Every other one has BEC. Used it to shut down my server after 4 hours of being online. now the system they are using is one that i need to set through the TCA ADMIN webpanel a scheduled task that shuts the server down at a definite time (has to be set to an hour, cant restart server before or the server will just shut off when the actual time to restart kicks in) ALSO even on top of us trying to figure out what hour or time the server is on, because local time as we know isnt the actual servers time. -- and in addition to figuring out when to shut down the server, you still need to incorporate messages that will be displayed in game. They have it kind of like BEC but its set up just to display messages at DEFINITE times. So when do i tell the server there is 1 hr left or 2? do I wait till the server restarts by itself.. I cant explain well enough how stupid this system they incorporated is.

 

 

But beyond my problems with my host GTX is there a way i can have it display a message when the server has been up for certain hours. or to restart the server from a script? 

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