PHP Code:
new iPlayersCountInServer = get_playersnum( 0 ); // Players which are connected will be counted
new iPlayersCountInServer = get_playersnum( 1 ); // Same with first + counting connecting players too
new iPlayers[ 32 ] = { 0, ... }, iCount = 0;
get_players( iPlayers, iCount );
if( iCount ) {
new iRandom = random_num( 0, iCount - 1 );
new iPlayer = iPlayers[ iRandom ];
new cName[ 32 ];
get_user_name( iPlayer, cName, 31 );
}