#include <amxmodx>
#include <reapi>
new iVip_CT = 0;
new iVip_T = 0;
public plugin_init()
{
register_plugin("VIP Informer", "1.0" , "rrr");
RegisterHookChain(RG_HandleMenu_ChooseTeam, "HandleMenu_ChooseTeam_Pre", false);
RegisterHookChain(RG_HandleMenu_ChooseTeam, "HandleMenu_ChooseTeam_Post", true);
}
public HandleMenu_ChooseTeam_Pre(const id, const MenuChooseTeam:slot)
{
if(get_user_flags(id) & ADMIN_LEVEL_H)
{
if(get_member(id, m_iTeam) == CS_TEAM_CT)
iVip_CT--;
else if(get_member(id, m_iTeam) == CS_TEAM_T)
iVip_T--;
}
}
public HandleMenu_ChooseTeam_Post(const id, const MenuChooseTeam:slot)
{
if(get_user_flags(id) & ADMIN_LEVEL_H)
{
if(get_member(id, m_iTeam) == CS_TEAM_CT)
iVip_CT++;
else if(get_member(id, m_iTeam) == CS_TEAM_T)
iVip_T++;
}
}
public client_putinserver(id)
set_task(1.0, "HUD", id, _, _, "b");
public client_disconnected(id)
{
if(get_user_flags(id) & ADMIN_LEVEL_H)
{
if(get_member(id, m_iTeam) == CS_TEAM_CT)
iVip_CT--;
else if(get_member(id, m_iTeam) == CS_TEAM_T)
iVip_T--;
}
}
public HUD(id)
{
if(get_member(id, m_iTeam) == CS_TEAM_CT)
{
set_hudmessage(10, 255, 255, 0.01, 0.26, 0, 6.0, 5.0, 0.08, 2.0);
show_hudmessage(id, "VIP CT: %d^nVIP TT: %d", iVip_CT, iVip_T);
}
else if(get_member(id, m_iTeam) == CS_TEAM_T)
{
set_hudmessage(255, 0, 0, 0.01, 0.26, 0, 6.0, 5.0, 0.08, 2.0);
show_hudmessage(id, "VIP CT: %d^nVIP TT: %d", iVip_CT, iVip_T);
}
return PLUGIN_CONTINUE;
}