/lotto problem
#5

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Here:
pawn Код:
// On top of your gamemode:
#define MAX_LOTTO_NUMBERS 100
new LottoNumbers[MAX_LOTTO_NUMBERS];

// This goes in the command:
if(LottoNumbers[number] == 1)
{
    // Lotto number is taken.
    return 1;
}
LottoNumbers[number] = 1;

// To reset the lotto numbers use the code below:
for(new i = 0; i < 100; i++)
{
    LottoNumbers[i] = 0;
}
That is a more efficient way of doing what I've posted. But if you're going for the most efficient you might want to use new bool:LottoNumbers[MAX_LOTTO_NUMBERS]; instead, because that will reduce the space needed for all that variables, since you'll just use 1 or 0 (true or false).
Reply


Messages In This Thread
/lotto problem - by Youssef214 - 15.06.2014, 23:16
Re: /lotto problem - by Kimossab - 15.06.2014, 23:24
Re: /lotto problem - by Cutt3r - 15.06.2014, 23:30
Re: /lotto problem - by SickAttack - 15.06.2014, 23:40
Re: /lotto problem - by Kimossab - 15.06.2014, 23:49
Re: /lotto problem - by SickAttack - 15.06.2014, 23:57
Re: /lotto problem - by Barnwell - 16.06.2014, 00:07

Forum Jump:


Users browsing this thread: 1 Guest(s)