#include <amxmodx>
#include <fun>
#define PLUGIN "Best Player"
#define VERSION "1.0"
#define AUTHOR "AndrewZ and noskill"
new bestplayer_name[ 32 ]
new higher_score
new g_MsgSync
public plugin_init()
{
register_plugin( PLUGIN, VERSION, AUTHOR )
set_task( 3.0, "show_BestPlayer", _, _, _, "b" )
g_MsgSync = CreateHudSyncObj()
}
public client_death()
{
for( new id = 1; id <= get_maxplayers(); id++ )
{
if( is_user_connected( id ) && !is_user_bot( id ) )
{
new user_frags = get_user_frags( id )
if( user_frags > higher_score )
{
higher_score = user_frags
get_user_name( id, bestplayer_name, 31 )
}
}
}
}
public show_BestPlayer()
{
if( higher_score != 0 )
{
set_hudmessage( 0, 100, 200, -1.0, 0.01, 2, 0.1, 5.0, 0.02, 0.02, -1 )
ShowSyncHudMsg( 0, g_MsgSync, "%s лидирует со счетом %d!", bestplayer_name, higher_score )
}
}