[FilterScript] Random Message on Server - 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: Filterscripts (
https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Random Message on Server (
/showthread.php?tid=524411)
Random Message on Server -
LarryTiger - 06.07.2014
Hello guys! Im here to post some simple script! This is my first Filterscript!
Код:
//Credits by LarryTiger
//http://forum.sa-mp.com/member.php?u=237011
#include <a_samp> //Main include
#define CURRENT_MESSAGES 10
//This is the number of the messages ^ Make sure its corret AT ALL TIMES!
#define MESSAGE_COLOR 0x4169E1FF
//The color of the messages ^ You can change it
#define MESSAGE_TIME 30
//These are the seconds in which every message is sent ^
new RM[CURRENT_MESSAGES][128];
forward SendRandomMessage();
public OnFilterScriptInit()
{
print("\n------------------------------------------");
print(" Hope you enjoy");
print(" Random Messages In Your server,");
print(" MADE BY Larry");
print("--------------------------------------------\n");
AddRandomMessage("Server: Hello guys! This is my first filterscript");
AddRandomMessage("Server: I am LarryTiger");
AddRandomMessage("Server: http://forum.sa-mp.com/member.php?u=237011");
AddRandomMessage("Server: Random Message");
AddRandomMessage("Server: Enjoy!");
AddRandomMessage("Server: Change this");
AddRandomMessage("Server: Change this");
AddRandomMessage("Server: Change this");
AddRandomMessage("Server: Change this");
AddRandomMessage("Server: Shout from my boys out");
SetTimer("SendRandomMessage", MESSAGE_TIME * 1000, 1);
return 1;
}
public SendRandomMessage()
{
static lastmessage = 0;
new rand = random(CURRENT_MESSAGES);
while(rand == lastmessage && CURRENT_MESSAGES != 1) { rand = random(CURRENT_MESSAGES); }
lastmessage = rand;
SendClientMessageToAll(MESSAGE_COLOR, RM[lastmessage]);
}
stock AddRandomMessage(text[])
{
for(new m; m < CURRENT_MESSAGES; m++)
{
if(!strlen(RM[m]))
{
strmid(RM[m], text, 0, 127);
return 1;
}
}
return 0;
}
Requirements:
a_samp.inc
Re: Random Message on Server -
AviPeker - 06.07.2014
Looks good

Keep Going
Re: Random Message on Server -
FahadKing07 - 06.07.2014
Hello,
Good work, keep it up.
+REP - Good luck with your beginning
Re: Random Message on Server -
Seaf - 06.07.2014
That is Good Iam Going Use It