Lotto system Question
#3

Well change the Random.
pawn Code:
public StartLotto()
{
    new string[256];
    new lotto = RandomEx(1, 61);
    new JackpotFallen = 0;
    format(string, sizeof(string), "Lottery News: Today, the winning number is: %d.", lotto);
    SendClientMessageToAll(COLOR_WHITE, string);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(PlayerInfo[i][pLotto] == lotto)
        {
            format(string, sizeof(string), "* You won $%d with your lottery ticket.", Jackpot);
            SendClientMessage(i, COLOR_YELLOW, string);
            GivePlayerCash(i, Jackpot);
            JackpotFallen = 1;
        }
        else
        {
            SendClientMessage(i, COLOR_LIGHTBLUE, "* This time I did not win.");
        }
        PlayerInfo[i][pLotto] = 0;
    }
    if(JackpotFallen)
    {
            new rand = random(250); rand += 250; // Max money you could start with is 500, min is 250.
        Jackpot = rand;
        format(string, sizeof(string), "Lottery News: Jackpot starts from: $%d.", Jackpot);
        SendClientMessageToAll(COLOR_WHITE, string);
    }
    else
    {
            new rand = random(100); rand += 50; // When someone buys a lotto the money will be  +50 to 150.
        Jackpot += rand;
        format(string, sizeof(string), "Lottery News: Jackpot reached: $%d.", Jackpot);
        SendClientMessageToAll(COLOR_WHITE, string);
    }
    return 1;
}
EDIT: The guy above got it 1st
Reply


Messages In This Thread
Lotto system Question - by Join7 - 23.08.2011, 19:49
Re: Lotto system Question - by Babul - 23.08.2011, 20:05
Re: Lotto system Question - by sleepysnowflake - 23.08.2011, 20:06
Re: Lotto system Question - by Join7 - 24.08.2011, 18:01
Re: Lotto system Question - by sleepysnowflake - 24.08.2011, 18:28
Re: Lotto system Question - by Join7 - 24.08.2011, 18:30
Re: Lotto system Question - by Join7 - 24.08.2011, 19:02

Forum Jump:


Users browsing this thread: 2 Guest(s)