AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   I Hate Convars (https://forums.alliedmods.net/showthread.php?t=333040)

little_froy 06-15-2021 23:36

I Hate Convars
 
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,

Psyk0tik 06-17-2021 00:16

Re: I Hate Convars [Wrong Forum section, move please]
 
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.

little_froy 06-17-2021 02:52

Re: I Hate Convars [Wrong Forum section, move please]
 
Quote:

Originally Posted by Crasher_3637 (Post 2750084)
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

asherkin 06-18-2021 07:03

Re: I Hate Convars
 
This rant doesn't really make sense, the SM API has methods to get both the default and the current value.

Dragokas 06-18-2021 20:25

Re: I Hate Convars [Wrong Forum section, move please]
 
little_froy, did you mean retrieving value set by config file?

Quote:

Originally Posted by little_froy (Post 2750098)
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.


All times are GMT -4. The time now is 23:18.

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