Random Messages blinking! Why?
#1

my random messages blinking whole time, why?

Код:
forward RandomMessage();
Код:
SetTimer("RandomMessage",1000,true);
Код:
new RandomMessages[][] =
{
	"~y~WestSide: ~w~Ukoliko uocite Hakera prijavite ga na ~r~/report",
    "~y~WestSide: ~w~Ukoliko ste novi na serveru, pisite ~g~/new",
    "~y~WestSide: ~w~Posijetite nas na forumu: ~r~http://ch-samp.com/forum/",
    "~y~WestSide: ~w~Uocili ste Bug? Prijavite ga na ~r~/report ~w~ i na ~g~forumu"
};
Код:
public RandomMessage()
{
	TextDrawSetString(KizlaRandomP, RandomMessages[random(sizeof(RandomMessages))]);
 	return 1;
}
Reply
#2

The 'true' in your SetTimer function is telling the server to call your RandomMessage() every 1000 milliseconds, that's why .

https://sampwiki.blast.hk/wiki/SetTimer
Quote:
funcname[] Name of the function to call as a string. Needs to be a public!
interval Interval in milliseconds.
repeating Boolean if the timer should occur repeatedly or only once
See if changing it to false will help.

Edit: or, it seems like you followed https://sampforum.blast.hk/showthread.php?tid=401096. If you want the messages to alternate periodically you should just increase the interval (from 1000, to something like 60000). Only change that last param to false if you want to select a random message once (in OnGameModeInit for instance).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)