Please help me ASAP
#6

Quote:
Originally Posted by SuperZak
Посмотреть сообщение
I removed public OnFilterScriptInit()
and public OnFilterScriptExit()
and put all those AddRandomMessage in public OnGameModeInit()
But it says now : error 017: undefined symbol "AddRandomMessage"
Coz you are doing it wrong
Try this
Код:
//add this somewhere above your ongamemodeinit
#define  AUTO_MESSAGE_TIME a // Change "a" to a specific time you want i.e 5
new AutoMessages[][] = {
	// Write Your messages here i.e Hey cheating is not allowed on my server
};
//Now you'll need to forward it so that it can be timed on OnGameModeInit()
forward AutoMessage();
public AutoMessage() {
	new string[128];
	format(string, sizeof(string), "%s", AutoMessages[random(sizeof(AutoMessages))]);
	SendClientMessageToAll("YOUR COLOR HERE", string);
	return 1;
}

public OnGameModeInit()
{
    SetTimer("AutoMessage",60*1000*AUTO_MESSAGE_TIME,1);
    return 1;
}
tell me when there is something wrong

You can also random the colors like this
Код:
forward AutoMessage();
public AutoMessage() {
	new string[128];
	format(string, sizeof(string), "%s", AutoMessages[random(sizeof(AutoMessages))]);
	new colors = random(5)+1;
	new color;
	switch(colors)
	{
	    case 1:
	    {
	        color = COLOR_FORSTATS;
	    }
	    case 2:
	    {
	        color = COLOR_PURPLE;
	    }
	    case 3:
	    {
	        color = COLOR_LIGHTRED;
	    }
		case 4:
	    {
	        color = COLOR_GREEN;
	    }
	    case 5:
	    {
	        color = COLOR_CYAN;
	    }
	}
	SendClientMessageToAll(color, string);
	return 1;
}
but of course it can still be simplified
Reply


Messages In This Thread
Please help me ASAP - by SuperZak - 02.02.2017, 20:20
Respuesta: Please help me ASAP - by Eloy - 02.02.2017, 20:37
Re: Please help me ASAP - by SuperZak - 03.02.2017, 07:13
Re: Please help me ASAP - by jamesbond007 - 03.02.2017, 07:29
Re: Please help me ASAP - by SuperZak - 03.02.2017, 07:40
Re: Please help me ASAP - by JesterlJoker - 03.02.2017, 08:09
Re: Please help me ASAP - by SuperZak - 03.02.2017, 10:29
Re: Please help me ASAP - by JesterlJoker - 04.02.2017, 02:31

Forum Jump:


Users browsing this thread: 1 Guest(s)