Quote:
Originally Posted by [ABK]Antonio
Hmm..Can make it even simpler by doing this
pawn Code:
#define MINUTES 3
new RandMessages[][] = { "Somethin", "Somethin2", "Somethin3" };
new RandTimer; //in case we want to kill it later forward RandomMessages();
pawn Code:
public OnGameModeInit() { RandTimer = SetTimer("RandomMessages", 60000*MINUTES, true); } public OnGameModeExit() { KillTimer(RandTimer); } public RandomMessages() { new Rand = random(sizeof(RandMessages)); SendClientMessageToAll(0x00CCCCAA, RandMessages[Rand]); }
|
Yes, I suppose that would be short and more simple, but this is merely showing how I personally do it. Although I appreciate you showing me this, and maybe I will add a part into the tutorial and explain how to do it using arrays.