Code:
stock get_random_players(iArray[4])
{
new iPlayers[32], iNum;
get_players(iPlayers, iNum, "ch");
for(new i = 0 ; i < 4 ; i++)
{
iArray[i] = iPlayers[random(iNum)];
}
}
iArray[4] (from 0 to 3) will be filled with random indexes of players that are connected on server. E.g
Code:
client_print(iArray[0], print_chat, "Hey there!");
__________________