Raised This Month: $32 Target: $400
 8% 

Get command line argument


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ghostdlr
Senior Member
Join Date: Aug 2010
Old 01-31-2023 , 11:58   Get command line argument
Reply With Quote #1

If hlds.exe was started with a custom command line argument, how can I get this variable?
For example:
hlds.exe +matchid 34452

I tried this but it doesn't work:

register_cvar("matchid", "")
get_cvar_num("matchid")


It works only when I put matchid 34452 in a config file but not as command parameter when the server starts.
ghostdlr is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 01-31-2023 , 14:57   Re: Get command line argument
Reply With Quote #2

did you try to retrieve the custom cvar value from server console when you assign it as a command line option?
jimaway is offline
ghostdlr
Senior Member
Join Date: Aug 2010
Old 01-31-2023 , 15:45   Re: Get command line argument
Reply With Quote #3

How do I do that?

If I write the matchid in console, it shows the value.

Last edited by ghostdlr; 01-31-2023 at 17:21.
ghostdlr is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 01-31-2023 , 19:28   Re: Get command line argument
Reply With Quote #4

hlds parameters are executed before metamod
__________________
bigdaddy424 is offline
Reply


Thread Tools
Display Modes

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 13:12.


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