I hope I understand well what you need. Your array will be filled with random value from 0 to 25. I prefer using another array since it's more fast and easy to do. Another method without using temporary array would be to fill the original array with -1 ( for example ) and each time checking the whole array if the random value is used or not.
Code:
#include <amxmodx>
public plugin_init ()
{
new MyArray [ 26 ] = { 0, 1, ... }; // --| Your array { 0, 1, 2, etc.. }
new ArrayTemp[ 26 ];
new i_Rand;
for ( new i; i < 26; i++ )
{
i_Rand = random_num ( 0, 25 );
if ( !ArrayTemp[ i_Rand ] ) // --| This random value is not used
{
MyArray[ i ] = i_Rand;
ArrayTemp[ i_Rand ] = 1; // --| This random value is now locked.
}
else // --| This random value is already used, need to try another value
{
--i;
}
}
// --| Results
for ( new i; i < 26; i++ )
{
log_amx ( "i = %d", MyArray[ i ] );
}
}
__________________