Raised This Month: $12 Target: $400
 3% 

[RESOLVED] Change Server Name


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dcell39
Junior Member
Join Date: Apr 2006
Old 03-10-2007 , 14:59   [RESOLVED] Change Server Name
Reply With Quote #1

Is there a way that the servers name can change to two different names when I turn gungame on or off?
examples:
gungame on server name will be "Random Gungame Server"
gungame off server name will be "Random Public Server"

Thanx

Last edited by XxAvalanchexX; 03-25-2007 at 22:07. Reason: marked resolved
Dcell39 is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 03-10-2007 , 15:37   Re: Change Server Name
Reply With Quote #2

Try this. Since it isn't integrated directly into GunGame, it can't hook exactly when GunGame is turned on or off, so it just does a check every minute.

Code:
 #include <amxmodx>  new cvOffName, cvOnName, oldValue = -1;  public plugin_init()  {     register_plugin("GunGame Hostname Changer","0.10","Avalanche");     cvOffName = register_cvar("gg_hostname_disabled","Random Public Server");     cvOnName = register_cvar("gg_hostname_enabled","Random Gungame Server");     set_task(5.0,"check_name",1);     set_task(60.0,"check_name",2,_,_,"b");  }  public check_name()  {     static newName[256];     new value = get_cvar_num("gg_enabled");     if(value == oldValue)         return;     if(value)         get_pcvar_string(cvOnName,newName,255);     else         get_pcvar_string(cvOffName,newName,255);     server_cmd("hostname ^"%s^"",newName);     oldValue = value;  }
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
ToT | V!PER
Senior Member
Join Date: Jun 2004
Location: Germany
Old 03-11-2007 , 10:13   Re: Change Server Name
Reply With Quote #3

Why not simply using the given CVARs for this? ;) Put your hostname into your server.cfg, and the gungame hostname you can enter within the gungame.cfg "gg_map_setup" cvar.
ToT | V!PER is offline
Send a message via ICQ to ToT | V!PER
Dcell39
Junior Member
Join Date: Apr 2006
Old 03-11-2007 , 16:09   Re: Change Server Name
Reply With Quote #4

I tried that but it stays the name and the cvar's from gungame.cfg or the "gg_map_setup"
I dont think it executes the server.cfg when it is turned off.
Maybe if we can include it to exec server.cfg when we turn it off?

Last edited by Dcell39; 03-11-2007 at 16:27.
Dcell39 is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 03-11-2007 , 17:58   Re: Change Server Name
Reply With Quote #5

1.16 does this. Or, you can use this temporary 1.15 mod that execs "no_gungame.cfg" on disable:
http://forums.alliedmods.net/showpos...03&postcount=6
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Dcell39
Junior Member
Join Date: Apr 2006
Old 03-12-2007 , 11:26   Re: Change Server Name
Reply With Quote #6

Ok ill give it a shot thanks
Dcell39 is offline
Dcell39
Junior Member
Join Date: Apr 2006
Old 03-12-2007 , 12:13   Re: Change Server Name
Reply With Quote #7

I tried downloading the temp 1.15 mod with the link you gave me but I get:
fatal error 100: cannot read from file: "fakemeta_util"
I get same error when I try to compile it myself
Dcell39 is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 03-12-2007 , 15:43   Re: Change Server Name
Reply With Quote #8

http://forums.alliedmods.net/showthread.php?t=28284 take fakemata_util.inc and put it into amxmodx/scripting/include! ;)
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 03-12-2007 , 17:00   Re: Change Server Name
Reply With Quote #9

To compile, you need fakemeta_util, which the web compiler does not have. This means you have to compile it locally, or just use the attached .amxx file.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Dcell39
Junior Member
Join Date: Apr 2006
Old 03-13-2007 , 08:30   Re: Change Server Name
Reply With Quote #10

Im am just gonna download 1.6beta and see what we got, so far thru hlsw it is executing server.cfg. I wont get to play for a day or so but I'll test it then. Thanx everyone for your help if I need more I'll ask somemore. Thanx again
Dcell39 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 14:19.


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