Hi. It is probably an easy thing to script but I have some problems with the code. See below:
PHP Code:
#include <amxmodx>
#define SIZE 10
new var[SIZE]
new iRandNum
public plugin_init()
{
register_plugin("Random Array Values", "v0.1", "t3h")
register_clcmd("say /print", "cmdPrint")
}
public cmdPrint(id)
{
for(new i=0; i < SIZE; i++)
{
iRandNum = random(SIZE)+1
for(new j = 0; j <= i; j++)
{
if(var[j] == iRandNum)
{
//here I need to repeat the first loop so that there would be another random number
}
}
var[i] = iRandNum
client_print(id, print_console, "Number: %d", var[i])
}
}