Serious help please
#4

Quote:
Originally Posted by misticini
Посмотреть сообщение
try this rapid implementation, i think this can resolve the problem:


Put this in top of your code after includes

Код:
new Control_Tickets[MAX_PLAYERS];
new last_ticket_position = 0;
This is when you buy a ticket.

Код:
Player[playerid][RaffleTicket] = random(100);
Control_Tickets[last_ticket_position]=playerid;
last_ticket_position++;
This is when its picking the ticket.

Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
	if(canraffle == 0)
	{
		if(gettime() == Player[i][RaffleTime])
		{
			//Player[i][RaffleTime] = gettime() + 345600;
			new lotto= Player[Control_Tickets[random(last_ticket_position)]][RaffleTicket];
			new Winnings = Player[i][JackPot];
			new string[128];
			if(lotto == Player[i][RaffleTicket])
			{
				format(string, sizeof(string), "Congratulations %s has won the lottery of %d", GetNameNoUnderScore(i), Winnings);
				SendClientMessageToAll(YELLOW, string);
				format(string, sizeof(string), "Congratulations you have won the lottery of %d", Winnings);
				SendClientMessage(i, YELLOW, string);
				SendClientMessageToAll(YELLOW, "Remember to buy a another raffle ticket if you want to take part in the next lottery");
				Player[i][RaffleTicket] = 0;
				Player[i][Money] += Winnings;
				canraffle = 1;
				for(new i=0; i<last_ticket_position; i++)
				{
					Control_Tickets[i]=0;
				}
				last_ticket_position=0;
			}
			else
			{
				Raffle();
			}
		}
	}
}
That just made my compiler stop working.

PLEASE HELP I HAVE BEEN TRYING TO DO THIS FOR DAYS

Thanks.
Reply


Messages In This Thread
Serious help please - by Euan Hughes - 23.07.2012, 13:17
Re: Serious help please - by Euan Hughes - 23.07.2012, 13:45
Re: Serious help please - by misticini - 23.07.2012, 13:49
Re: Serious help please - by Euan Hughes - 23.07.2012, 13:54
Re: Serious help please - by misticini - 23.07.2012, 15:28
Re: Serious help please - by Babul - 23.07.2012, 15:37

Forum Jump:


Users browsing this thread: 2 Guest(s)