Offensichtlich hast du Google nicht bemüht, aber gut, das hier sollte dir einen Überblick verschaffen wie man so eine Funktion schreibt.
|
PHP-Quelltext
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
stock Functionsname(...)
{
new tRandClient[MaxClients];
new tRandCount;
for(new i; i <= MaxClients; i++)
{
if(/* Deine Validatorfunktion */)
{
tRandClient[tRandCount] = i;
tRandCount++;
}
}
return tRandClient[GetRandomInt(0, tRandCount-1)];
}
|
Vergiss die Index Checks nicht.
MfG
Impact