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 09-30-2014 , 12:08   Re: Module: Cvar Utilities (v1.6)
Reply With Quote #161

I will add some forward in AMXX in core, it has been requested anyway, but it won't contain all what CU does because some are kind of pointless. I won't add CU module as it is, code could be better and also more appropriate to integrate this with current system in core.
__________________
Arkshine is offline
glhf3000
Member
Join Date: Aug 2010
Location: middle-universe
Old 11-03-2014 , 11:32   Re: Module: Cvar Utilities (v1.6)
Reply With Quote #162

Arkshine, you are GGGGODLIKE!

Last edited by glhf3000; 11-03-2014 at 11:38.
glhf3000 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-29-2014 , 04:24   Re: Module: Cvar Utilities (v1.6)
Reply With Quote #163

About the CvarCache native: how it's different from using get_pcvar natives ?

How about that ?
Quote:
Originally Posted by Arkshine View Post
I will add some forward in AMXX in core, it has been requested anyway, but it won't contain all what CU does because some are kind of pointless. I won't add CU module as it is, code could be better and also more appropriate to integrate this with current system in core.
__________________

Last edited by HamletEagle; 12-29-2014 at 04:27.
HamletEagle is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-29-2014 , 04:28   Re: Module: Cvar Utilities (v1.6)
Reply With Quote #164

CvarCache caches the value of a cvar into the provided global variable, and that variable is updated automagically by the module when needed.
Difference is by caching using a variable (meaning giving to CU a reference to this variable), you don't need to use cvar natives anymore and plugin basically checks a simple variable vs a native.
__________________

Last edited by Arkshine; 12-29-2014 at 04:34.
Arkshine is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-29-2014 , 04:45   Re: Module: Cvar Utilities (v1.6)
Reply With Quote #165

This is what I wanted to hear, automatically updated. You are awesome But any news on this features introduced to amxx core ?

Quote:
automagically
:O
__________________

Last edited by HamletEagle; 12-29-2014 at 04:54.
HamletEagle is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-01-2015 , 09:27   Re: Module: Cvar Utilities (v1.6)
Reply With Quote #166

This native doesn't exists:
PHP Code:
  /* Or directly :
        CvarHookChangeCache( register_cvar( "MyCvar", "1337" ), CvarType_Int, Variable ); */ 
Did you mean CvarHookChange ?

Edit: By reading the documentation I think it was CvarCache.
Edit2: Server crashed

Code:
Protocol version 48
Exe version 1.1.2.7 (cstrike)
Exe build: 17:46:18 Apr 25 2013 (6027)
Errors when loading the module:
Code:
[META] dll: Loaded plugin 'Cvar Utilities': Cvar Utilities v1.6 Feb 28 2013, Arkshine
L 01/01/2015 - 06:48:38: [META] ERROR: Failed to find memloc for regcmd 'cvarutil'
L 01/01/2015 - 06:48:38: [META] ERROR: Failed to find memloc for regcmd 'cu'
Code:
meta list
Currently loaded plugins:
      description      stat pend  file              vers      src  load  unlod
 [ 1] AMX Mod X        RUN   -    amxmodx_mm.dll    v1.8.2    ini  Start ANY  
 [ 2] Fun              RUN   -    fun_amxx.dll      v1.8.2    pl1  ANY   ANY  
 [ 3] Orpheu           RUN   -    orpheu_amxx.dll   v2.5.1    pl1  ANY   ANY  
 [ 4] CStrike          RUN   -    cstrike_amxx.dll  v1.8.2    pl1  ANY   ANY  
 [ 5] CSX              RUN   -    csx_amxx.dll      v1.8.2    pl1  ANY   ANY  
 [ 6] okapi            RUN   -    okapi_amxx.dll    v1.0      pl1  ANY   ANY  
 [ 7] FakeMeta         RUN   -    fakemeta_amxx.dl  v1.8.2    pl1  ANY   ANY  
 [ 8] Ham Sandwich     RUN   -    hamsandwich_amxx  v1.8.2    pl1  ANY   ANY  
 [ 9] Engine           RUN   -    engine_amxx.dll   v1.8.2    pl1  ANY   ANY  
 [10] Cvar Utilities   RUN   -    cvar_util_amxx.d  v1.6      pl1  ANY   ANY  
10 plugins, 10 running
What I have in my plugin:
PHP Code:
CvarCache(register_cvar("bomb_status_team""0"), CvarType_IntHandleCvar[TeamAcces])
    
CvarCache(register_cvar("hud_r_color""0"), CvarType_IntHandleCvar[ColorR])
    
CvarCache(register_cvar("hud_g_color""255") , CvarType_IntHandleCvar[ColorG])
    
CvarCache(register_cvar("hud_b_color""85") , CvarType_IntHandleCvar[ColorB])
    
CvarCache(register_cvar("bomb_status_commands""1"), CvarType_IntHandleCvar[CommandsStatus])
    
CvarCache(register_cvar("bomb_status_c_spamtime""10"), CvarType_IntHandleCvar[CommandsSpamTime])
    
CvarCache(register_cvar("bomb_status_logs""0") , CvarType_IntHandleCvar[LogsStatus])
    
CvarCache(get_cvar_pointer("mp_c4timer"), CvarType_IntHandleCvar[ExplosionTime]) 
Edit3: after some test I found out that the crash was due to: //CvarCache(get_cvar_pointer("mp_c4timer"), CvarType_Int, HandleCvar[ExplosionTime])
__________________

Last edited by HamletEagle; 01-01-2015 at 09:56.
HamletEagle is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-30-2015 , 10:39   Re: Module: Cvar Utilities (v1.6)
Reply With Quote #167

These kind of features that CvarUtil offers, has been intgerated in latest dev build : https://github.com/alliedmodders/amxmodx/pull/185

This module is unmaintained from now because code is not that great and what offers latest AMXX build is basically CvarUtil but done in the right way, at least it makes more sense. Also, this is better integrated to AMXX.

I would recommend to not use this module anymore.
__________________
Arkshine is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-30-2015 , 11:19   Re: Module: Cvar Utilities (v1.6)
Reply With Quote #168

Quote:
Originally Posted by Arkshine View Post
These kind of features that CvarUtil offers, has been intgerated in latest dev build : https://github.com/alliedmodders/amxmodx/pull/185

This module is unmaintained from now because code is not that great and what offers latest AMXX build is basically CvarUtil but done in the right way, at least it makes more sense. Also, this is better integrated to AMXX.

I would recommend to not use this module anymore.
But for the ones who still code for latest version of amxx(1.8.2) is no alternative to this module.
__________________
HamletEagle is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-30-2015 , 12:17   Re: Module: Cvar Utilities (v1.6)
Reply With Quote #169

Module does a lot of unnecessary things, in an improper way. It's not really worth to work on it, especially probably almost no one use it.

Well, if there is really a critical bug, I can try to fix it, but I won't do much.

Like about CvarCache, providing a simple test plugin which reproduces the issue would help.
__________________
Arkshine is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-30-2015 , 13:04   Re: Module: Cvar Utilities (v1.6)
Reply With Quote #170

Well, I use it in my BombStatus plugin. In the above, CvarCache crash the server when you directly use with get_cvar_pointer, no other things are needed.
For default cvars I use CvarHookChange to find out when the value is changed.
__________________

Last edited by HamletEagle; 01-30-2015 at 13:04.
HamletEagle 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 06:01.


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