08.07.2012, 01:04
Hello. I was wondering what the Usage of "Random" is, because I want it to send random message's to the players, as like a tool-tip?
forward RandomMessage();
new RandomMessages[8][156] =
{
"message1",
"message2",
"message3",
"message4",
"message5",
"message6",
"message7",
"message8"
};
public OnGameModeInit()
{
SetTimer("RandomMessage",60000,1); //every minute the message is sent
return 1;
}
public RandomMessage()
{
SendClientMessageToAll(COLOR, RandomMessages);
return 1;
}
new
szRandMessages[][] = {
{"Message one"}, // 0
{"Message two"}, // 1
{"Message three"}, // 2
{"Message four"}, // 3
{"Message five"}, // 4
{"Message six"}}; // 5
public OnGameModeInit()
{
SetTimer("RandomMessages", 30000, 1);
return 1;
}
forward RandomMessages();
public RandomMessages()
{
SendClientMessageToAll(-1, szRandMessages[random(sizeof(szRandMessages))]);
print("30 secs");
return 1;
}