27.02.2009, 03:06
Tutorial
Heres my first tut! a tut on how to make random server adverts!
First: add to the top of your GM
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.
Next: where you put your forwards put:
Next: under your GameModeInit
The "60000" = 1 minute, this means a random message will be sent to all ever 1 minute. You Can Change it to whatever You Want To!
Next: at the bottom of your script
you can put whatever color you want to but i put cyan.
And Thats it! Now You can send advert messages to your players!
Heres my first tut! a tut on how to make random server adverts!
First: add to the top of your GM
pawn Код:
#define COLOR_CYAN 0x99FFFFAA // cyan
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.
Next: where you put your forwards put:
pawn Код:
forward AdvertMsg();
pawn Код:
SetTimer("AdvertMsg",60000,1);
Next: at the bottom of your script
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;
}
And Thats it! Now You can send advert messages to your players!