[FilterScript] Random Message on Server
#1

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
Reply
#2

Looks good
Keep Going
Reply
#3

Hello,

Good work, keep it up.

+REP - Good luck with your beginning
Reply
#4

That is Good Iam Going Use It
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)