[Tutorial] Simple Random Messages
#4

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]);
}
Reply


Messages In This Thread
Simple Random Messages - by 2KY - 16.01.2012, 16:55
Re: Simple Random Messages - by 2KY - 19.01.2012, 03:34
Re: Simple Random Messages - by lamarr007 - 19.01.2012, 04:11
Re: Simple Random Messages - by [ABK]Antonio - 19.01.2012, 04:24
Re: Simple Random Messages - by 2KY - 19.01.2012, 18:58

Forum Jump:


Users browsing this thread: 1 Guest(s)