Test this one:
PHP Code:
#include <amxmodx>
public plugin_init( )
{
register_clcmd( "say /test" , "test" );
}
public test( id )
{
new szName[32];
get_user_name( RandomPlayer() , szName, charsmax( szName ) );
client_print( id , print_chat, "The name of a random players is %s" , szName );
}
// Return the ID of a random ALIVE player
RandomPlayer()
{
new Players[32] , Num;
get_players( Players, Num, "a" );
return Players[ random( Num ) ];
}
__________________