Automatic messages - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Automatic messages (
/showthread.php?tid=275651)
Automatic messages -
Panormitis - 10.08.2011
Hello guys, how can i make an automatic message that will appear ine the chat every 20 minutes
Re: Automatic messages -
Riddick94 - 10.08.2011
Few messages? random messages? one message at time?
Re: Automatic messages -
Panormitis - 10.08.2011
Quote:
Originally Posted by Riddick94
Few messages? random messages? one message at time?
|
one random message every 10 minutes
Re: Automatic messages -
Riddick94 - 10.08.2011
pawn Код:
#include "a_samp"
#define MINUTES(%1) ((%1)*(60*1000))
new RandomMessages[][] =
{
"Your random messages here",
"I",
"Love",
"You Riddick!" // after last you can't put ','
};
public OnGameModeInit()
{
SetTimer("AutomaticMessage", MINUTES(10), true);
return true;
}
forward AutomaticMessage();
public AutomaticMessage()
{
new RandomMessage = random(sizeof(RandomMessages));
SendClientMessageToAll(-1, RandomMessages[RandomMessage]); // -1 is a colour for a message.
return true;
}
One fail.. fixed now.