Quote:
Originally Posted by GarbageBox
I decided to give up 
I had watch your tutorial's. It seems very difficult to me 
|
Getting random values isn't difficult at all.
You basically want to set up all values you want in an array.
Then, as you select values, delete them from the array.
Code:
stock random_range(_min, _max, output[], size)
{
new Array:values = ArrayCreate(1), numValues;
for(new i = _min; i <= _max; i++)
{
ArrayPushCell(values, i);
numValues++;
}
new rand, i;
while(i < size && numValues > 0)
{
rand = random(numValues);
output[i++] = ArrayGetCell(values, rand);
ArrayDeleteItem(values, rand);
numValues--;
}
ArrayDestroy(values);
return i;
}
__________________