Raised This Month: $ Target: $400
 0% 

help me


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
RuRuRu612754
Senior Member
Join Date: Sep 2011
Old 12-04-2011 , 02:53   help me
Reply With Quote #1

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)
	}
}
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