[Tutorial] Random Server Adverts
#10

Quote:
Originally Posted by Ethan1233
pawn Код:
new AdvertMessage[5][100] = // [5] = amount of messages, [100] = amount of characters to give
{
    {"Ad: Donate To The Server!"},
    {"Ad: Visit Our Forums!"},
    {"Ad: Visit Out Site!"},
    {"Ad: Got A Question? Visit The FAQ"},
    {"Ad: Be Cool!"}
};
Those messages are examples of what it could say... just remember, the "[100]" means the ammount of characters so the bigger the message, the more your going to need to add to that.
There's no need to define anything here, actually. AdvertMessage[][0] would work just as well. And you don't need {} brackets for each item either.


Quote:
Originally Posted by Ethan1233
pawn Код:
public AdvertMsg()
{
  for (new i = 0; i < MAX_PLAYERS; i++)
  {
    new rand;
    rand = random(sizeof(AdvertMessage));
    SendClientMessageToAll(COLOR_CYAN,AdvertMessage[rand][0]);
    break;
   
  }
    return 1;
}
You're using a useless loop which will send a random message globally 200 times. Surely this is not what you intended. Test this code with more than one person on your server. I'm afraid you are starting with a few misconceptions.
Reply


Messages In This Thread
[Tutorial] Random Server Adverts - by StrickenKid - 27.02.2009, 03:06
Re: [Tutorial] Random Server Adverts - by ReV. - 27.02.2009, 03:08
Re: [Tutorial] Random Server Adverts - by Nimphious - 27.02.2009, 03:11
Re: [Tutorial] Random Server Adverts - by StrickenKid - 27.02.2009, 03:17
Re: [Tutorial] Random Server Adverts - by ReV. - 27.02.2009, 03:17
Re: [Tutorial] Random Server Adverts - by Nimphious - 27.02.2009, 03:23
Re: [Tutorial] Random Server Adverts - by Backwardsman97 - 27.02.2009, 03:33
Re: [Tutorial] Random Server Adverts - by Nimphious - 27.02.2009, 03:35
Re: [Tutorial] Random Server Adverts - by Backwardsman97 - 27.02.2009, 04:12
Re: [Tutorial] Random Server Adverts - by Frank_Tesla - 27.02.2009, 05:47

Forum Jump:


Users browsing this thread: 1 Guest(s)