Raised This Month: $51 Target: $400
 12% 

Module: Cvar Utilities (v1.6)


Post New Thread Reply   
 
Thread Tools Display Modes
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-09-2011 , 07:44   Re: Cvar Utilities
Reply With Quote #31

Quote:
You have the cvar description inputted in with registering a cvar. What exactly is it's purpose? It would be nice if somewhere there was a command for an admin to display all cvars with their descriptions. Or maybe a file to be generated for all mods using this module, or each individual plugin that lists it like...
Since the cvar description doesn't exist by default, the purpose is more to be used with others plugins, like the AutoExecConfig by Connor which generates a list of command/cvar and here, the description could be put like the command. Even, in others plugins to know what does the cvar, you could imagine a menu with a cvar list and below each item showing the description. You get the idea. It's up to people to use it, more I encourage, like the command, to put by default a description.

Quote:
This should be added into amxx core...
I'm not sure Bail' would be willing to accept to integrate into the core some memory stuffs. But at least, if it could be put as default module, it would be nice.

Quote:
It would be super cool if amxx or this would support boolean cvars with only <0/1>
You can do it with my module.

Quote:
I've found a bug. If you have show cvar changes enabled, and you have a min/max value for a cvar set, it messages the cvar has "changed" to the value entered, when you're mod cancels it. It's a bit misleading.
Can you show some code so I understand better ?
__________________
Arkshine is offline
Tirant
Veteran Member
Join Date: Jul 2008
Location: Los Angeles, California
Old 07-09-2011 , 12:13   Re: Cvar Utilities
Reply With Quote #32

All I did was register a cvar, and set a min and max value. The amxx show commands or whatever cvar displays "my_cvar" changed to "100" when the limit is 1.

What I mean by Boolean function, was a special register that automatically only takes 0/1, since many cvars are just that.
__________________

PM me if you're interested in buying the Credits addition for Base Builder
Battlefield Rebirth [66% done]
Call of Duty: MW2 [100% done]
Base Builder [100% done]
Tirant is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-09-2011 , 15:06   Re: Cvar Utilities
Reply With Quote #33

Show me your code, will see better.

With my module you can force 0 or 1. (see forceInterval)
__________________
Arkshine is offline
Tirant
Veteran Member
Join Date: Jul 2008
Location: Los Angeles, California
Old 07-09-2011 , 15:11   Re: Cvar Utilities
Reply With Quote #34

Force interval works, but amx show commands doesn't. I'll show when I get home, but there is only registering a new cvar. Set a cvar to forceinterval and then amx show admin commands to "1" and type an invalid value. I'll post later if you don't understand this when I'm home, it is literally only "a = CvarRegister(...)"
__________________

PM me if you're interested in buying the Credits addition for Base Builder
Battlefield Rebirth [66% done]
Call of Duty: MW2 [100% done]
Base Builder [100% done]
Tirant is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-09-2011 , 15:15   Re: Cvar Utilities
Reply With Quote #35

I would like, because i'm confused and I would understand better if I see the code.
__________________
Arkshine is offline
Tirant
Veteran Member
Join Date: Jul 2008
Location: Los Angeles, California
Old 07-09-2011 , 16:43   Re: Cvar Utilities
Reply With Quote #36

This should produce the error. It's not really an error with your module, it's just that you're module isn't blocking or telling amx_cvar that the value isn't really what your module has clamped it to.

You need to enable the show admin commands feature on amxmodx and type "amx_cvar my_boolean_cvar 15". While your module properly blocks it to 1, the amx_cvar message says differently.

Code:
#include <amxmodx>
#include <cvar_util>

public plugin_init() {
    register_plugin(Plugin, Version, Author);
    
    CvarRegister("my_boolean_cvar", "0", _, FCVAR_SERVER, .hasMin = true, .minValue = 0.0, .hasMax = true, .maxValue = 1.0 );
}
__________________

PM me if you're interested in buying the Credits addition for Base Builder
Battlefield Rebirth [66% done]
Call of Duty: MW2 [100% done]
Base Builder [100% done]
Tirant is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-09-2011 , 16:55   Re: Cvar Utilities
Reply With Quote #37

Ahh~

Really not thought about base plugin at all.
Damn.

I guess I've no choice to provide modified plugins... :/
__________________
Arkshine is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-05-2011 , 05:32   Re: Cvar Utilities
Reply With Quote #38

Small update.

v1.2 - 5 sept 2011
Bug
  • Added an amxx plugin to fix amx_cvar command not showing the right value after a change because of locked/bounded.
New feature
  • Added CvarCache native to cache a cvar value in a global variable and so being auto-updated on change.
  • Added a new status flag CvarStatus_WasOutOfBound to know if the value of the last change on this cvar was out of bound.
    (not really useful, just created for the provided plugin to simplify the code)
Minor changes
  • Changed param pluginId of CvarLockInfo native as optional now.
  • Added the optional param forceInterval for CvarGetBounds native.


Note #1 : Check the installation procedure.
Note #2 : Check the examples about the use of CvarCache.
__________________
Arkshine is offline
Tirant
Veteran Member
Join Date: Jul 2008
Location: Los Angeles, California
Old 09-05-2011 , 08:21   Re: Cvar Utilities
Reply With Quote #39

Thank you very much. I've been using this a lot in all my new plugins, it's really VERY handy IMO. The new feature of caching updated cvar values into variables will be really helpful. I usually had to try and cache them into a variable on change automatically.

When I was trying to download and extract the archive, I get this error...

Quote:
! C:\...\...\Downloads\cvar_util-files.zip: Unknown method in cvar_util-files\addons\amxmodx\modules\cvar_util_amxx.d ll
! C:\...\...\Downloads\cvar_util-files.zip: Unknown method in cvar_util-files\addons\amxmodx\modules\cvar_util_amxx_i 386.so
! C:\...\...\Downloads\cvar_util-files.zip: Unknown method in cvar_util-files\addons\amxmodx\scripting\cu_amx_cvar_fi x.sma
! C:\...\...\Downloads\cvar_util-files.zip: Unknown method in cvar_util-files\addons\amxmodx\scripting\include\cvar_u til.inc
I believe it's corrupt.
__________________

PM me if you're interested in buying the Credits addition for Base Builder
Battlefield Rebirth [66% done]
Call of Duty: MW2 [100% done]
Base Builder [100% done]
Tirant is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-05-2011 , 08:48   Re: Cvar Utilities
Reply With Quote #40

Weird. Try again. I've compressed/uploaded again the packages. (Compressed with 7-Zip)

I'm glad you like my module. I wish more people using it !
__________________
Arkshine 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 03:28.


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