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

Public cvar without notifying changes to clients


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 08-13-2008 , 10:47   Public cvar without notifying changes to clients
Reply With Quote #1

Is it possible to have a public cvar (for for example HLSW) but not have it show changes in chat? I'm changing this cvar every 20 seconds, so it's annoying to have it show in chat. It seems FCVAR_NOTIFY both makes it a public cvar and makes it notify changes to clients
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.

Last edited by DJ Tsunami; 08-13-2008 at 10:54.
DJ Tsunami is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 08-13-2008 , 16:03   Re: Public cvar without notifying changes to clients
Reply With Quote #2

strip the flag, change the value and add the flag again
berni is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 08-13-2008 , 18:34   Re: Public cvar without notifying changes to clients
Reply With Quote #3

That could work Thanks.

Edit: ok, that works, but now for some reason the cvar is only updated half the time in HLSW. So if I have a 20 second timer running, it's only updated every 40 seconds. Now I can work around this by using a 10 second timer, but it's just weird. The code is pretty basic:
Code:
SetCommandFlags("cvar", FCVAR_PLUGIN|FCVAR_SPONLY); SetConVarString(g_hCvar, "string"); SetCommandFlags("cvar", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_NOTIFY);
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.

Last edited by DJ Tsunami; 08-13-2008 at 18:50.
DJ Tsunami is offline
Reply


Thread Tools
Display Modes

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 19:00.


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