Raised This Month: $ Target: $400
 0% 

modifying a cvar inside HookConVarChange


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
ratty
SourceMod Donor
Join Date: Jan 2006
Old 01-06-2008 , 15:58   modifying a cvar inside HookConVarChange
Reply With Quote #1

I'm using ferret's auto-alltalk plugin to learn from, I want to make sure it actually works, and also make it print a message.

I think it gets really confused when you change a cvar, inside an function that is called from HookConVarChange on that same cvar. I made it print a message about it turning it on and off, and this is what I get when limit is reached:

Code:
L 01/06/2008 - 12:50:49: [autoalltalk.smx] [SM] 2 players, setting alltalk to 0.
L 01/06/2008 - 12:50:49: [autoalltalk.smx] [SM] 2 players, setting alltalk to 1.
L 01/06/2008 - 12:50:49: [autoalltalk.smx] [SM] 2 players, setting alltalk to 0.
L 01/06/2008 - 12:50:49: [autoalltalk.smx] [SM] 2 players, setting alltalk to 1.
L 01/06/2008 - 12:50:49: [autoalltalk.smx] [SM] 2 players, setting alltalk to 0.
L 01/06/2008 - 12:50:49: [autoalltalk.smx] [SM] 2 players, setting alltalk to 1.
L 01/06/2008 - 12:50:49: [autoalltalk.smx] [SM] 2 players, setting alltalk to 0.
L 01/06/2008 - 12:50:49: [autoalltalk.smx] [SM] 2 players, setting alltalk to 1
Is that something that is SUPPOSED to work, or is that a no-no? I think the problem might be that it cant test the state of it properly with GetConVarBool until after the function is done, I'm not sure.
ratty is offline
 



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 05:26.


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