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

SetConVarInt() problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 08-25-2012 , 19:42   SetConVarInt() problem
Reply With Quote #1

here we go again... always have a problem

PHP Code:
new Handle:blackwhite;
new 
Handle:blackwhite_changed;
public 
OnPluginStart()
{
    
blackwhite CreateConVar("blackwhite_max""2""max incap count to black n white"FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_NOTIFY);
    
AutoExecConfig(true"l4d2_blackwhite");
    
blackwhite_changed FindConVar("blackwhite_max");
    
SetConVarInt(FindConVar("survivor_max_incapacitated_count"), GetConVarInt(blackwhite_changed)); 
}

Somehow the "survivor_max_incapacitated_count" try to change to 5 but no effect. where is my mistake?
in my "l4d2_blackwhite.cfg" already set to 5.

Last edited by GsiX; 08-25-2012 at 19:43.
GsiX is offline
McFlurry
Veteran Member
Join Date: Mar 2010
Location: RemoveEdict(0);
Old 08-25-2012 , 22:52   Re: SetConVarInt() problem
Reply With Quote #2

Random guess here, but you're only setting it on OnPluginStart. The Cvar might be changing more than just once.
__________________
McFlurry is offline
Send a message via Skype™ to McFlurry
ReFlexPoison
☠☠☠
Join Date: Jul 2011
Location: ☠☠☠
Old 08-25-2012 , 23:01   Re: SetConVarInt() problem
Reply With Quote #3

Probably best off spreading this into OnMapStart() or OnConfigsExecuted() as it will re-check multiple times instead of just once.
ReFlexPoison is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 08-26-2012 , 02:30   Re: SetConVarInt() problem
Reply With Quote #4

Quote:
Originally Posted by ReFlexPoison View Post
Probably best off spreading this into OnMapStart() or OnConfigsExecuted() as it will re-check multiple times instead of just once.
Quote:
Originally Posted by McFlurry View Post
Random guess here, but you're only setting it on OnPluginStart. The Cvar might be changing more than just once.
cheers, that is the problem and it solved now. Thanks a lot
__________________
If i happen to insulted you unintentionally,
it was me and Google Translate who did it.
GsiX 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 03:16.


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