#include <amxmodx>
#include <amxmisc>
#include <reapi>
new g_bwSend, bool:g_Enable = false;
public plugin_init()
{
register_plugin("49 44 49", "20 4E 41", "58 59 49"); // privet sok.
if(get_cvar_pointer("mp_scoreboard_showhealth"))
{
register_message(get_user_msgid("Account"), "Event");
g_Enable = true;
}
if(get_cvar_pointer("mp_scoreboard_showmoney"))
{
register_message(get_user_msgid("HealthInfo"), "Event");
g_Enable = true;
}
}
public Event(msg_id, msg_dest, id)
{
//msg_dest == MSG_ALL cause crashes again?
if(!is_user_connected(id))
{
return 0;
}
if(!(g_bwSend & (1 << (id & 31))))
{
return 1;
}
return 0;
}
public client_putinserver(id)
{
if(!g_Enable)
{
return;
}
g_bwSend &= ~(1 << (id & 31));
if(is_user_bot(id)||is_user_hltv(id))
{
return;
}
if(REU_GetProtocol(id) == 48)
{
query_client_cvar(id, "sv_version", "check_sv_version");
}
}
public check_sv_version(id,const cvar[],const value[])
{
new a = strlen(value);
if(a < 21)
{
return;
}
if(str_to_num(value[a - 4]) >= 8244)
{
g_bwSend |= (1 << (id & 31));
}
}