PHP Code:
static const int MY_ARRAY[] = {0xA, 0xB, 0xC, 0xD, 0xE, 0, 1, 2, 3, 4};
void GetRandom()
{
ArrayList hList = CreateArray();
int i = -1, rnd[3], pos;
for(; ++i < sizeof(MY_ARRAY);) hList.Push(MY_ARRAY[i]);
for(i=-1; ++i < 3 && hList.Length;)
{
rnd[i] = hList.Get(GetRandomInt(0, (hList.Length - 1)));
hList.Erase(i);
if((rnd[i] == 0xA && (pos = hList.FindValue(0)) != -1) || (rnd[i] == 0 && (pos = hList.FindValue(0xA)) != -1))
hList.Erase(pos);
}
CloseHandle(hList);
PrintToChatAll("Random number = %i, %i, %i", rnd[0], rnd[1], rnd[2]);
}
__________________