[ajuda] Random !
#9

Usando IRL(https://sampforum.blast.hk/showthread.php?tid=269457):
pawn Код:
//Criando nъmeros a ser sorteados:
new RandomList:Loteria;
Loteria = CreateRandomList();
for(new i = 1; i < 51; i++) AddItemsToRandomList(Loteria, i);
//Obter nъmeros random
new Numbers[6];
Numbers[0] = RandomNumberFromList(Loteria);
RemoveItemsFromRandomList(Loteria, Numbers[0]);
Numbers[1] = RandomNumberFromList(Loteria);
RemoveItemsFromRandomList(Loteria, Numbers[1]);
Numbers[2] = RandomNumberFromList(Loteria);
RemoveItemsFromRandomList(Loteria, Numbers[2]);
Numbers[3] = RandomNumberFromList(Loteria);
RemoveItemsFromRandomList(Loteria, Numbers[3]);
Numbers[4] = RandomNumberFromList(Loteria);
RemoveItemsFromRandomList(Loteria, Numbers[4]);
Numbers[5] = RandomNumberFromList(Loteria);
RemoveItemsFromRandomList(Loteria, Numbers[5]);
//Destruindo lista
DestroyRandomList(Loteria);
Usando foreach: (https://sampforum.blast.hk/showthread.php?tid=92679)
pawn Код:
//Criando nъmeros a ser sorteados:
new Iterator:Numeros<50>;
for(new i = 1; i < 51; i++) Itter_Add(Numeros, i);
//Obter nъmeros random
new Numbers[6];
Numbers[0] = Itter_Random(Numeros);
Itter_Remove(Numeros, Numbers[0]);
Numbers[1] = Itter_Random(Numeros);
Itter_Remove(Numeros, Numbers[1]);
Numbers[2] = Itter_Random(Numeros);
Itter_Remove(Numeros, Numbers[2]);
Numbers[3] = Itter_Random(Numeros);
Itter_Remove(Numeros, Numbers[3]);
Numbers[4] = Itter_Random(Numeros);
Itter_Remove(Numeros, Numbers[4]);
Numbers[5] = Itter_Random(Numeros);
Itter_Remove(Numeros, Numbers[5]);
Reply


Messages In This Thread
[ajuda] Random ! - by Rick_DR - 03.03.2012, 00:58
Re: [ajuda] Random ! - by GuiihCamargo - 03.03.2012, 02:50
Re: [ajuda] Random ! - by Ricop522 - 03.03.2012, 03:29
Re: [ajuda] Random ! - by DarkScripter - 03.03.2012, 03:50
Re: [ajuda] Random ! - by Ricop522 - 03.03.2012, 04:28
Re: [ajuda] Random ! - by DarkScripter - 03.03.2012, 04:49
Re: [ajuda] Random ! - by Rick_DR - 03.03.2012, 12:30
Re: [ajuda] Random ! - by Ricop522 - 03.03.2012, 14:58
Re: [ajuda] Random ! - by CyNiC - 03.03.2012, 15:57
Re: [ajuda] Random ! - by rodrigooo - 03.03.2012, 16:15

Forum Jump:


Users browsing this thread: 1 Guest(s)