jim_yang
thanks
problem was solved by using the define
However, even if not read the server_up connect to the server
However, even if not read the server_down disconnect to the server
Code:
#include <amxmodx>
#define server_up "exec addons/amxmodx/configs/server_up.cfg"
#define server_down "exec addons/amxmodx/configs/server_down.cfg"
new count = 0
public plugin_init()
{
register_plugin("PLUGIN", "VERSION", "AUTHOR")
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)
}
}
server_up.cfg
Code:
pb add 1
pb add 1
pb add 1
pb add 1
pb add 1
pb add 1
pb add 1
pb add 1
pb add 1
pb add 1
server_down.cfg