Raised This Month: $ Target: $400
 0% 

help me


Post New Thread Reply   
 
Thread Tools Display Modes
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
jim_yang
Veteran Member
Join Date: Aug 2006
Old 12-04-2011 , 03:01   Re: help me
Reply With Quote #2

you use server_cmd on a cvar pointer, that's the problem.
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
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
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-04-2011 , 12:38   Re: help me
Reply With Quote #4

Quote:
Originally Posted by RuRuRu612754 View Post
However, even if not read the server_up connect to the server
However, even if not read the server_down disconnect to the server
What?
__________________
fysiks is offline
RuRuRu612754
Senior Member
Join Date: Sep 2011
Old 12-05-2011 , 00:38   Re: help me
Reply With Quote #5

plugin is not working properly
Connected to server server_up.cfg not read
Disconnected to server server_down.cfg not read

sorry
I cannot speak english
I have bad English because I use the google translator
RuRuRu612754 is offline
Erox902
Veteran Member
Join Date: Jun 2009
Location: Never Never Land
Old 12-05-2011 , 07:15   Re: help me
Reply With Quote #6

PHP Code:
server_cmd(server_down
--->
PHP Code:
server_cmd(exec server_down.cfg
And so on for all server_cmds.
Erox902 is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 12-05-2011 , 08:16   Re: help me
Reply With Quote #7

Quote:
Originally Posted by Erox902 View Post
PHP Code:
server_cmd(server_down
--->
PHP Code:
server_cmd(exec server_down.cfg
And so on for all server_cmds.
you forgot to add " "
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-05-2011 , 17:26   Re: help me
Reply With Quote #8

Quote:
Originally Posted by Erox902 View Post
PHP Code:
server_cmd(server_down
--->
PHP Code:
server_cmd(exec server_down.cfg
And so on for all server_cmds.
That's not a solution. His exec commands will work just fine. It's probably something else like having the wrong filepath.

Note that "exec server_down.cfg" is not the same as "exec addons/amxmodx/configs/server_down.cfg"
__________________

Last edited by fysiks; 12-05-2011 at 17:27.
fysiks is offline
RuRuRu612754
Senior Member
Join Date: Sep 2011
Old 12-05-2011 , 23:04   Re: help me
Reply With Quote #9

thanks all
RuRuRu612754 is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 12-06-2011 , 04:11   Re: help me
Reply With Quote #10

get_pcvar_string( ).
__________________
You can do anything you set your mind to, man.

Devil259 is offline
Reply



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