[ANY] ConVar Suppression
1 Attachment(s)
Huge thanks to Berni's Snippet.
What does this do? Depends on what you do with it. However, the only function I'm immediately aware of is suppressing selected ConVar changes from being printed to chat. Oh? Is that all? Yes. Thanks! ... Are there any commands? Indeed there are. As a matter of fact, there is only one. sm_suppressconvar <convar> <enabled|disabled> - Whether to display changes of this ConVar to Chat or not. Can you give an example? Sure! sm_suppressconvar sm_nextmap enabled THIS ALREADY EXISTS :sadpirate: Oh. Ok. Sorry! At this present time I'm unaware of any that are not hard coded. |
Re: [ANY] ConVar Suppression
Thanks Kyle! I've wanted something like this for awhile!
|
Re: [ANY] ConVar Suppression
It amuses me that your code only checks the first letter. So, if I were to write
Code:
sm_suppressconvar mp_restartgame do Having said that, I wasn't aware that there was a server_cvar event. It seems like a lot more work to hook server_cvar and do it there rather than just stripping FCVAR_NOTIFY from the cvar, though... Edit: Also, I'm disappointed to see a plugin approver reusing the same string buffer for three different arguments in the same function. While you could argue it's efficient, it's very hard to maintain later. |
Re: [ANY] ConVar Suppression
*sigh*, refraining from the many negative comments the above poster really deserves, nice work Kyle. Didn't realize the server_cvar event existed either!
|
Re: [ANY] ConVar Suppression
Quote:
|
Re: [ANY] ConVar Suppression
Quote:
|
Re: [ANY] ConVar Suppression
Quote:
Quote:
|
Re: [ANY] ConVar Suppression
Quote:
Quote:
Quote:
If you have any further questions or concerns in regards to this plugin please let me know. EDIT: Oops! Quote:
If I were to rewrite the above hard coded snippet, it would look something like this. PHP Code:
|
Re: [ANY] ConVar Suppression
Quote:
1. The command name at the first ReplyToCommand. 2. The second argument at the StringToInt. 3. The first argument at the second, third, and fourth ReplyToCommands. This is one of those things that makes maintenance programmers (want to) kill previous programmers. Speaking of functionality, it might be a good idea to check if the ConVar exists (checking FindConVar against INVALID_HANDLE) before adding it to the trie, returning common.phrases's "Unable to find cvar" phrase if not found: PHP Code:
|
Re: [ANY] ConVar Suppression
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
|
All times are GMT -4. The time now is 12:35. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.