You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some reason, RunConsoleCommand doesn't work when it's indirectly called by ply:ConCommand
] version
Protocol version 24
Exe version 2025.03.26 (garrysmod)
Exe build: 18:16:47 May 1 2025 (9662) (4000)
GMod version 2025.05.03, branch: x86-64, multicore: 0
Windows 64bit
Steps to reproduce
Here "gmod_mcore_test changed from " will never print, as the convar never changes
ifCLIENTthenRunConsoleCommand( "gmod_mcore_test", 0 )
concommand.Add( "testcommand", function()
print( "ran?", GetConVarNumber( "gmod_mcore_test" ) )
RunConsoleCommand( "gmod_mcore_test", 1 )
end )
cvars.AddChangeCallback( "gmod_mcore_test", function( name, oldValue, newValue )
print( "gmod_mcore_test changed from " ..oldValue.." to " ..newValue )
end, "gmod_mcore_test_cvartest" )
endifSERVERthentimer.Simple( 3, function()
me:ConCommand( "testcommand" )
end )
end
Here for whatever reason it does seem to run when i add a 0 tick timer:
ifCLIENTthenRunConsoleCommand( "gmod_mcore_test", 0 )
concommand.Add( "testcommand", function()
print( "ran?", GetConVarNumber( "gmod_mcore_test" ) )
timer.Simple( 0, function()
RunConsoleCommand( "gmod_mcore_test", 1 )
end )
end )
cvars.AddChangeCallback( "gmod_mcore_test", function( name, oldValue, newValue )
print( "gmod_mcore_test changed from " ..oldValue.." to " ..newValue )
end, "gmod_mcore_test_cvartest" )
endifSERVERthentimer.Simple( 3, function()
me:ConCommand( "testcommand" )
end )
end
The text was updated successfully, but these errors were encountered:
Details
For some reason,
RunConsoleCommand
doesn't work when it's indirectly called byply:ConCommand
Steps to reproduce
Here "gmod_mcore_test changed from " will never print, as the convar never changes
Here for whatever reason it does seem to run when i add a 0 tick timer:
The text was updated successfully, but these errors were encountered: