I do not know the problem
Where is the problem?
Code:
#include <amxmodx>
new count = 0
new server_down
new server_up
public plugin_init()
{
register_plugin("PLUGIN", "VERSION", "AUTHOR")
server_up = register_cvar("server_up", "addons/amxmodx/configs/server_up.cfg")
server_down = register_cvar("server_down", "addons/amxmodx/configs/server_down.cfg")
count = 0
set_task(10.0,"check")
}
public check()
{
if(count == 1)
{
server_cmd(server_up)
}
if(count == 0)
{
server_cmd(server_down)
}
}
public client_connect(id)
{
if(is_user_hltv(id) || is_user_bot(id))
{
count += 1
}
if(count == 1)
{
server_cmd(server_up)
}
}
public client_disconnect(id)
{
if(is_user_hltv(id) || is_user_bot(id))
{
count -= 1
}
if(count == 0)
{
server_cmd(server_down)
}
}