21.03.2010, 06:32
Hey I was just wondering if anyone had any idea how to make automatic announcements come up in the chatbox every now and then for example, "Visit our website at www.blahblahblah.com"?
forward AutoMsg();
SetTimer("AutoMsg",900000,1); // Auto message in every XX minutes
public AutoMsg()
{
SendClientMessageToAll(YOURCOLOR, "EPIC FAIL");
return 1;
}
Originally Posted by [AXS
Bryce ]
if i add lots of these announcments and i set it to 1 minute then will all of them pop up in the chat box at the same time? coz if it does then that would be kinda crap.. lol |
#define Announce_Time 2 // In minutes
#define Number_Of_Announcements 37 // Change this to the number of announcements
new Announcements[Number_Of_Announcements][0] = {
{"Announcement 1"},
{"Announcement 2"},
{"Announcement 3 (Notice no ',' after the '}'! "}
};
public OnGameModeInit()
{
SetTimerEx("Announce", Announce_Time*60000, 1, "i");
return 1;
}
forward Announce();
public Announce()
{
new RandAn = random(sizeof(Announcements));
SendClientMessageToAll(COLOUR, Announcements[RandAn]);
return 1;
}