18.07.2015, 08:07
A lot easier and faster way than creating another array:
pawn Код:
randomin(min, max) return random(max - min) + min;
bool:NumberInUse(number)
{
for (new i; i < MAX_FURNI; i++) if (FurniCode[i] == number) return false;
return true;
}
FreeNumber()
{
new number = randomin(100000, 1000000);
while (NumberInUse(number)) number = randomin(100000, 1000000);
return number;
}