Raised This Month: $ Target: $400
 0% 

Read server launch options (registered cvar)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sickM0nkey
Junior Member
Join Date: Aug 2012
Location: Latvia
Old 08-28-2012 , 22:32   Read server launch options (registered cvar)
Reply With Quote #1

Is it possible to set non existent cvar (cvar registered only in plugin) from server launch options and then read it from plugin? I guess not? I'm trying to accomplish that but without success! :/
__________________
n00b
sickM0nkey is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-28-2012 , 23:17   Re: Read server launch options (registered cvar)
Reply With Quote #2

What exactly are you trying to do? Don't tell me the method you "think" is the solution, tell me what you want the end result to be.
__________________
fysiks is offline
DjOptimuS
Senior Member
Join Date: Jan 2009
Old 08-29-2012 , 00:00   Re: Read server launch options (registered cvar)
Reply With Quote #3

create a cfg and add to the console startup +exec config.cfg
DjOptimuS is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-29-2012 , 00:21   Re: Read server launch options (registered cvar)
Reply With Quote #4

That would still execute around the same time the servercfgfile executes, which is after the cvars are registered
__________________
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
sickM0nkey
Junior Member
Join Date: Aug 2012
Location: Latvia
Old 08-29-2012 , 08:23   Re: Read server launch options (registered cvar)
Reply With Quote #5

Adding cvar to config file is not an option! I need to pass cvar with launch options like so
Code:
hlds.exe -game cstrike -console +mycvar 3 +map de_dust2
and then read it from script with
Code:
get_cvar_num("mycvar")

It works only if cvar is defined in configs, but like I said, it's not an option for me. I guess it do not work because "mycvar" is not standard HL cvar and plugin is not executed at that time, so server do not keep record of that var?

I hope Im wrong! So, how can I read cvar from server startup parameters?

ty!
__________________
n00b

Last edited by sickM0nkey; 08-29-2012 at 08:24.
sickM0nkey is offline
matsi
Thinkosaur
Join Date: Sep 2006
Old 08-29-2012 , 09:22   Re: Read server launch options (registered cvar)
Reply With Quote #6

Explain us why you 'need' to do that and you'll get better answers. I'm sure there are other ways of doing what you want.
__________________

Accepting all kinds of requests via private message.
matsi is offline
sickM0nkey
Junior Member
Join Date: Aug 2012
Location: Latvia
Old 08-29-2012 , 14:41   Re: Read server launch options (registered cvar)
Reply With Quote #7

One way to do that is by connecting to database. Each time server runs, it gets different variable value. Server will be launched remotely by cmd. There is no option to write new config file each time.
__________________
n00b

Last edited by sickM0nkey; 08-29-2012 at 20:58.
sickM0nkey is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-29-2012 , 18:46   Re: Read server launch options (registered cvar)
Reply With Quote #8

Quote:
Originally Posted by fysiks View Post
What exactly are you trying to do? Don't tell me the method you "think" is the solution, tell me what you want the end result to be.
__________________
fysiks is offline
sickM0nkey
Junior Member
Join Date: Aug 2012
Location: Latvia
Old 08-29-2012 , 21:19   Re: Read server launch options (registered cvar)
Reply With Quote #9

Server will be launched remotely several times a day! There is need for setting one cvar (registered in plugin) with different value each time server starts. There is no option to write cvar in server config file so it should be passed with launch options or when plugins starts it reads it from database.

Sorry for lack of info. This cvar defines the tournament id for server. I will stick to database option, because I have to poll additional data from db any way.. . like players, teams etc.
__________________
n00b

Last edited by sickM0nkey; 08-29-2012 at 21:21.
sickM0nkey 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 05:49.


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