Send a message after given period of time
#1

Hello, I'm wondering how to make gamemode to send a given message to the chat after some period of time, I'm wondering if any callback like that exist, also I would appreciate for any help.
Reply
#2

You have to create that for your own:

PHP код:
//In OnGameModeInit
SetTimer("SendServerMessage"1000*60*50); //Sends after 5min a Message to the server
//Outside any function
forward SendServerMessage();
public 
SendServerMessage()
{
    
SendClientMessageToAll(-1"* This is a Message, sent after 5min of the Server start!");
    return 
1

You can look up in the wiki the specific functions and change that, to whatever you want
Reply
#3

Thanks! I also have one more question, How do I make it to be sent after each 5 minutes? (not only after a server start)
Reply
#4

Quote:
Originally Posted by xenocideniki
Посмотреть сообщение
Thanks! I also have one more question, How do I make it to be sent after each 5 minutes? (not only after a server start)
Just change repeating param to true. It should look like this:

Код:
SetTimer("SendServerMessage", 1000*60*5, true);

forward SendServerMessage(); 
public SendServerMessage() 
{ 
    SendClientMessageToAll(-1, "* This is a Message, sent after 5min of the Server start!"); 
    return 1;  
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)