register_cvar and create_cvar
What are the differences between register_cvar and create_cvar ?
Is create_cvar better to use ? Is register_cvar deprecated ? |
Re: register_cvar and create_cvar
Just visit below to learn more:
1. http://www.amxmodx.org/api/cvars/create_cvar 2. http://www.amxmodx.org/api/cvars/register_cvar |
Re: register_cvar and create_cvar
i still don't understand
register_cvar : Registers a new cvar for the engine. create_cvar : Creates a new cvar for the engine. what is the difference ? |
Re: register_cvar and create_cvar
The difference is create_cvar has more arguments, allowing you to provide a description and enabling a minimum/maximum value.
If you know about it, it's my Cvar Utilities module integrated to AMXX in a more sane way. As side-note, providing at least a description is useful if you're using AutoExecConfig, which generates a config file per plugin with cvar value/description/bounds.
Exemple
|
Re: register_cvar and create_cvar
Quote:
but in api it's a note, and that note says : "Deprecated. Consider to use create_cvar for more options.", then if it's deprecated why we can still use ? i mean.. look at client_disconnect, it's practically deprecated, not just theoretically like register_cvar. (#pragma deprecated Use client_disconnected() instead.) may i create a pull request to fully deprecate the register_cvar and use create_cvar on amxx plugins ? |
Re: register_cvar and create_cvar
There is no issue with register_cvar. Saying deprecated is just to encourage coder to include description. The case with client_disconnect is because there is an actual issue using it
|
Re: register_cvar and create_cvar
Quote:
|
Re: register_cvar and create_cvar
|
Re: register_cvar and create_cvar
There is nothing inherently wrong with register_cvar() so it's confusing that you create a new alternate function. Maybe since it is an augmentation of registering cvar, the name should be an augmentation of the existing function (e.g. format and formatex).
|
Re: register_cvar and create_cvar
Quote:
|
| All times are GMT -4. The time now is 18:12. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.