Heres me code now how do I check if the gmans_test is used in console?
CreateClientConVar("gmans_test", 0)
You could add a callback for that command: [url]http://wiki.garrysmod.com/page/cvars/AddChangeCallback[/url]
is that right?
cvars.AddChangeCallback("gmans_test", function()
if GetConVarNumber("gmans_test") == 1 then
print("stuff")
end
[code]cvars.AddChangeCallback("gmans_test", function( )
if ( GetConVarNumber( "gmans_test" ) == 1 ) then
print( "stuff" );
end
end ); -- end for the function( ) and ); for the cvars.AddChangeCallback[/code]
Close, missing tabs for beautifying it, an end for the function and an end parenthesis ) for the function call.
I'm confused, are you trying to make a console command, or are you just trying to check when the cvar is changed...
Sorry, you need to Log In to post a reply to this thread.