Posted by: Face9000
« on: February 09, 2011, 08:12:49 pm »
Have a populated server and want some messages showing in the middle of the screen at all players?
Well,with this tutorial now u can.
WARNING: THERE ARE NOT NORMAL MESSAGE PASTED IN CHAT,BUT ANNOUNCES WITH YOUR TEXT SHOWING IN THE MIDDLE OF SCREEN.
Let's start by creating a timer of 120000 milliseconds (2 minutes). You can always change it.
Paste it under OnGameModeInit:
SetTimer("AutoAnn",120000,1);
Now,let's create the forward and the public function.
Paste the code where u want.
forward AutoAnn();
public AutoAnn()
{
new randANN = random(sizeof(RandomANN));
GameTextForAll(RandomANN[randANN], 10000, 4);
return 1;
}
Explain:
We've created the forward and the public function.
With:
new randANN = random(sizeof(RandomANN));
Server will take a random text (Look under for more info) and shows as announce ingame.
GameTextForAll(RandomANN[randANN], 10000, 4);
Is for show the announce.
Ok,now we got all,we need only to create the auto announces.
Add where you want,this:
new RandomANN[][] =
{
"Announce 1",
"Announce 2",
"Announce 3"
};
Remember to DONT PUT THE , AT YOUR LAST ANNOUNCE!
And here we go,simple and easy.