Send a message after given period of time - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Send a message after given period of time (
/showthread.php?tid=664863)
Send a message after given period of time -
xenocideniki - 13.03.2019
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.
Re: Send a message after given period of time -
Kaliber - 13.03.2019
You have to create that for your own:
PHP код:
//In OnGameModeInit
SetTimer("SendServerMessage", 1000*60*5, 0); //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
Re: Send a message after given period of time -
xenocideniki - 13.03.2019
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)
Re: Send a message after given period of time -
feartonyb - 13.03.2019
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;
}