SA-MP Forums Archive
Server broadcasts. - 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: Server broadcasts. (/showthread.php?tid=517292)



Server broadcasts. - CesarLT - 04.06.2014

Hello everyone, I was wondering..I am currently scripting a DM server, and I'd like to know how to make a message, which will be posted automatically like every 10~15 minutes. Like, "Don't forget to visit our forums at ..."
And how is it possible to make multiple messages? Thanks in advance.


Re: Server broadcasts. - Parallex - 04.06.2014

pawn Код:
// Somewhere at your script:
forward RandomMessage(); // Or whatever name you want.

// Under OnGameModeInit:
SetTimer("RandomMessage",120000,1); // Change the timer according to what you prefer.

//Any place you like:
public RandomMessage()
{
    new mrand =random(1); // Change the number according to the number of messages you're going to send
    if(mrand == 1)
    {
    SendClientMessageToAll(0xFFF000AA,"Visit our forums at: put forum here etc");
    }
}



Re: Server broadcasts. - Konstantinos - 04.06.2014

https://sampwiki.blast.hk/wiki/Random_Messages


Re: Server broadcasts. - CesarLT - 04.06.2014

Quote:
Originally Posted by BenJackster
Посмотреть сообщение
pawn Код:
// Somewhere at your script:
forward RandomMessage(); // Or whatever name you want.

// Under OnGameModeInit:
SetTimer("RandomMessage",120000,1); // Change the timer according to what you prefer.

//Any place you like:
public RandomMessage()
{
    new mrand =random(1); // Change the number according to the number of messages you're going to send
    if(mrand == 1)
    {
    SendClientMessageToAll(0xFFF000AA,"Visit our forums at: put forum here etc");
    }
}
Thanks alot!