Raised This Month: $ Target: $400
 0% 

variable from server config


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sparkey
Senior Member
Join Date: May 2010
Old 05-08-2010 , 17:24   Re: variable from server config
Reply With Quote #1

sry did not mean to confuse you guys when are so kindly helpful.

I am going to run arount 20 servers and each server needs to have a specific id in the amxmodx plugin when updating the mysql database. I do not want to make one plugin for every server cause that feels kinda worthless.

Then my thought was to just make one config for every server but now when i am acctully thinking the best would be to give a startup parameter when starting the hlds instance that the amxmodx plugin later on grabs.

If really hope i did not confuse you any more now.

Thx for your help!
sparkey is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-08-2010 , 17:28   Re: variable from server config
Reply With Quote #2

Just create a cvar like "server_id" and then add "server_id <numberhere>" to each server.cfg that is running the plugin (each number would be different of course).
__________________
fysiks is offline
sparkey
Senior Member
Join Date: May 2010
Old 05-08-2010 , 20:43   Re: variable from server config
Reply With Quote #3

that is exactly what i tried the frist i did. I know how to register the cvar if i define the value in the plugin but i cant really figure out how i can get the value from the server.cfg so i dont have to create one plugin for each server.
sparkey is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 05-08-2010 , 23:05   Re: variable from server config
Reply With Quote #4

That is why in each server you put a different number for the server_id cvar. Are you perhaps using 1 amxx.cfg file for all of your servers?
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
sparkey
Senior Member
Join Date: May 2010
Old 05-08-2010 , 23:14   Re: variable from server config
Reply With Quote #5

Yes thats correct. I am using the same hlds files for all the running instances. I forgot to mention the most important thing.
sparkey is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-09-2010 , 00:09   Re: variable from server config
Reply With Quote #6

I think you might be able to use different server.cfg's through the command line. Then you can put server_id in each of the different server.cfg's.
__________________
fysiks is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 05-09-2010 , 00:19   Re: variable from server config
Reply With Quote #7

You could just compare server IP's (which you'd need logged in the plugin) and register the cvar value based on which IP you're logging it from. It'd be pretty simple; let me know if you need it explained via plugin.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
sparkey
Senior Member
Join Date: May 2010
Old 05-09-2010 , 10:49   Re: variable from server config
Reply With Quote #8

Thx ALOT man, i dont know why it never came to my mind to compare the ip of the server

Big thx to all you guys for your help and time.
sparkey 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 03:35.


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