/lotto problem
#4

Here:
Version without bool:
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 < MAX_LOTTO_NUMBERS; i++)
{
    LottoNumbers[i] = 0;
}
Version with bool (Suggested by Kimossab):
pawn Код:
// On top of your gamemode:
#define MAX_LOTTO_NUMBERS 100
new Bool:LottoNumbers[MAX_LOTTO_NUMBERS];

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

// To reset the lotto numbers use the code below:
for(new i = 0; i < MAX_LOTTO_NUMBERS; i++)
{
    LottoNumbers[i] = false;
}
Note: "bool" is a weak tag and "Bool" is a strong tag.
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)