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

I Hate Convars


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
little_froy
Senior Member
Join Date: May 2021
Old 06-15-2021 , 23:36   I Hate Convars
Reply With Quote #1

every round start i need to reset something, using the offical API of sourcemod can only get the default value but not adujusted value of convars.
although there is a lib made by another script author to solved the problem, but why they had to do by not offical ???
I HATE Convars,

Last edited by little_froy; 06-15-2021 at 23:37.
little_froy is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 06-17-2021 , 00:16   Re: I Hate Convars [Wrong Forum section, move please]
Reply With Quote #2

Did you try hooking the convar?

https://sm.alliedmods.net/new-api/co.../AddChangeHook

You can check the old and new values of a convar when they change.
__________________
Psyk0tik is offline
little_froy
Senior Member
Join Date: May 2021
Old 06-17-2021 , 02:52   Re: I Hate Convars [Wrong Forum section, move please]
Reply With Quote #3

Quote:
Originally Posted by Crasher_3637 View Post
Did you try hooking the convar?

https://sm.alliedmods.net/new-api/co.../AddChangeHook

You can check the old and new values of a convar when they change.
that's work, but every first go into game round start, the value only can be the default. after another round start just be newer
little_froy is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 06-18-2021 , 07:03   Re: I Hate Convars
Reply With Quote #4

This rant doesn't really make sense, the SM API has methods to get both the default and the current value.
__________________
asherkin is online now
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 06-18-2021 , 20:25   Re: I Hate Convars [Wrong Forum section, move please]
Reply With Quote #5

little_froy, did you mean retrieving value set by config file?

Quote:
Originally Posted by little_froy View Post
that's work, but every first go into game round start, the value only can be the default. after another round start just be newer
It should, unless you have too many ConVars in configs causing overflow for some games.

Did you try Anomaly Fixer (or Buffer Overflow Fixer)? It doesn't specially have a native to retrieve such value (I can add if you need), but it force all ConVars to be exactly matched with the one in configs at round start.

--
BTW, I'm also thinking why that still not fixed officially.

I'm also thinking under alternate extension-based version - where ConVar.Default will be just replaced by values from Config file during ConVar creation time. Not nice solution, but effective.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 06-18-2021 at 20:25.
Dragokas 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 18:59.


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