Author Topic: How to make autoannounces  (Read 239 times)

Face9000

  • Newbie
  • *
  • Posts: 7
  • Reputation +0/-0
    • View Profile
How to make autoannounces
« 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:

Code: [Select]
SetTimer("AutoAnn",120000,1);
Now,let's create the forward and the public function.

Paste the code where u want.

Code: [Select]
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:

Code: [Select]
new randANN = random(sizeof(RandomANN));
Server will take a random text (Look under for more info) and shows as announce ingame.

Code: [Select]
  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:

Code: [Select]
new RandomANN[][] =
{
    "Announce 1",
    "Announce 2",
   "Announce 3"
};

Remember to DONT PUT THE , AT YOUR LAST ANNOUNCE!

And here we go,simple and easy.

Share on Bluesky Share on Facebook


Jane

  • Management
  • Full
  • *******
  • Posts: 130
  • Reputation +1/-0
  • mIRC Scripters
    • View Profile
Re: How to make autoannounces
« Reply #1 on: February 09, 2011, 08:24:14 pm »
Great Scripts as always !