Raised This Month: $ Target: $400
 0% 

help me


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
RuRuRu612754
Senior Member
Join Date: Sep 2011
Old 12-04-2011 , 03:14   Re: help me
Reply With Quote #3

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
Code:
pb removebots
RuRuRu612754 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:27.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode