The following function can help you find a random player.You can use this for minigames
Code Select
function onPlayerCommand( player, cmd, text )
{
else if ( cmd == "rand" )
{
local RandPlayerID = FindRandPlayer();
print ( "Random PlayerID " + RandPlayerID );
}
}
function FindRandPlayer()
{
local
MAX_PLAYERS = 50,
count = 0,
buffer = "",
param;
for(local i = 0; i < MAX_PLAYERS; i++)
{
if ( FindPlayer( i ) )
{
buffer = buffer + " " + i;
count++;
}
}
param = split(buffer, " ");
return param[ rand() % count ];
}