Sorry for double posting but I have another question related to this thread.
I want to make so that at the end there would be printed 8 numbers (defined with NUMSTOPRINT) in the client's console but none of them would be the one that holds
AnotherRandVar value. Hope you understand what I mean.
PHP Code:
#include <amxmodx>
#define SIZE 10
#define NUMSTOPRINT 8
new var[SIZE]
public plugin_init()
{
register_plugin("Random Array Values", "v0.1", "thh33")
register_clcmd("say /print", "cmdPrint")
}
public cmdPrint(id)
{
new tmp[SIZE];
for(new i = 0; i < SIZE; i++)
{
tmp[i] = i + 1;
}
new rand, tsize = SIZE;
for(new i = 0; i < SIZE; i++)
{
rand = random(tsize);
var[i] = tmp[rand];
tmp[rand] = tmp[--tsize];
}
//SEE FROM HERE:
new AnotherRandVar = random(SIZE)+1
for(new i=0; i<=NUMSTOPRINT; i++)
{
if(var[i] == AnotherRandVar)
{
//don't print this value, print another one
}
client_print(id, print_console, "Num: %d", var[i])
}
}
So at the end there will be printed 8 different numbers and none of them is
AnotherRandVar.