how to detect if a command has been ran?

hi how would i detect if a clientside command has been run by the player like “lua_openscript_cl” , i imagine maybe like a detour or something im not sure

theres no way to detect that as far as I know, else anti-cheats would have it easy to block nearly all cheats.

I actually wrote an anticheat a long while ago that did get triggered when a client ran lua_openscript_cl.
I’ll try to find the code for ya bud

[editline]23rd September 2016[/editline]

I think it was this:

[lua]

jit.attach( 
	function(func)
		local src = jit.util.funcinfo( func ).source
		src = string.gsub(src, "@", "")
		
		print( src )
	end,
	
	"bc"
)

[/lua]

If someone is running lua_openscript_cl, in most cases, sv_allowcslua and/or sv_cheats are set to 1. You shouldn’t be looking for people explicitly running lua_openscript_cl, you should be looking for signs of foreign execution, such as source checking, or the existence of cvars and console commands that are created in cheats.

Pretty much every public cheat creates a cvar or concommand.

also check if protected cvars are set to a value that’s not synced with the server but is changed for the client, popular public bypasses force sv_allowcslua to 1 to do such a thing