pawn Код:
new
notRandomArray[] = { 9, 6, 3, 8, 5, 2, 0, 4, 1, 7 }, // Nъmeros de 0 a 9 arranjados aleatуriamente
selectedNum1,
selectedNum2
;
SelectTwoNumbers() { // Esta funзгo vai atribuir as variбveis acima dois valores da array, sendo que o primeiro й aleatуrio e o segundo й o prуximo nъmero na array.
static index;
index = random(sizeof notRandomArray);
selectedNum1 = notRandomArray[index];
selectedNum2 = (index + 1 < sizeof notRandomArray) ? notRandomArray[index + 1] : notRandomArray[0];
}
public OnGameModeInit() {
SelectTwoNumbers(); // Vocк deve usar a funзгo antes de usar os nъmeros
printf(" # %d, %d", selectedNum1, selectedNum2); // Teste vocк mesmo.
return 1;
}