Hey,
Im still having issues how to use cvars in source python, wiki couldnt help me much, thats why im asking here to be sure.
1. How can I get a cvar?
Lets say mp_timelimit;float
2. How can I set/change a cvar value?
3. How can I create a cvar?
lets say xx_version == 1.0.1
How to use Cvars
Re: How to use Cvars
It's quite easy! 

Syntax: Select all
from cvars import ConVar
# Get an existing ConVar
mp_timelimit = ConVar('mp_timelimit')
print(mp_timelimit.get_float())
# Create a new ConVar
my_convar = ConVar('my_convar')
# Set a ConVar
my_convar.set_int(10)
Re: How to use Cvars
Thank you!
Re: How to use Cvars
Also, to create a ConVar with the config package:
http://builds.sourcepython.com/job/Sour ... onfig.html
That needs some updating, but should suffice.
And, for a public versioning ConVar:
http://builds.sourcepython.com/job/Sour ... blicConVar
http://builds.sourcepython.com/job/Sour ... onfig.html
That needs some updating, but should suffice.
And, for a public versioning ConVar:
http://builds.sourcepython.com/job/Sour ... blicConVar
Return to “Plugin Development Support”
Who is online
Users browsing this forum: No registered users and 93 guests