23.08.2011, 20:06
Well change the Random.
EDIT: The guy above got it 1st
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;
}
