Help Advertise timer
#1

Hey i use this code for advertising forum and irc but all this does is flood the chat endlessly...any solution
Код:
#include <a_samp>
new Advertise_Gen1_idx, Advertise_Gen1[][] = {
	"Remember to visit our forum at -------.",
	"Admins 24/7 online at our IRC channel #-----. But players can join it too."
};
public OnFilterScriptInit()
{
	SetTimer("Advertise_Gen2", (00152), 1);
}
forward Advertise_Gen2();
public Advertise_Gen2()
{
	if(Advertise_Gen1_idx == sizeof(Advertise_Gen1))
		Advertise_Gen1_idx = 0;
	SendClientMessageToAll(0xCCFF00, Advertise_Gen1[Advertise_Gen1_idx]);
	Advertise_Gen1_idx ++;
}
+Rep who helps me first
Reply
#2

No one?
Reply
#3

Will call the function just once like this.
Код:
SetTimer("Advertise_Gen2", (00152), 0);
Reply
#4

Quote:

SetTimer("Advertise_Gen2", (00152), 1);

It wil repeat calling Advertise function every 0.1.2 of the second(script will call every 1 second)

you can use it like


PHP код:
SetTime("Advertise_Gen2",300000,1); // 300 000  = 5 (by ****** calculation) 
Reply
#5

Just set the timer to 60000 milliseconds (1 minute) it doesn't flood.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)