Usage of Random
#7

You need to learn to do arrays if you want random messages.
pawn Код:
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;
}
Reply


Messages In This Thread
Usage of Random - by Dubya - 08.07.2012, 01:04
Re: Usage of Random - by Kirollos - 08.07.2012, 01:22
Re: Usage of Random - by coole210 - 08.07.2012, 01:25
Re: Usage of Random - by MP2 - 08.07.2012, 01:40
Re: Usage of Random - by coole210 - 08.07.2012, 01:47
Re: Usage of Random - by SnG.Scot_MisCuDI - 08.07.2012, 01:47
Re: Usage of Random - by ReneG - 08.07.2012, 05:58

Forum Jump:


Users browsing this thread: 2 Guest(s)