Command logger / blocker [for RunConsoleCommand and what not for finding exploits]

Posts 1–6 of 6 · Page 1 of 1
Command logger / blocker [for RunConsoleCommand and what not for finding exploits]
/threadtitle

I need one / ideas on making one.
Code:
local rcc = RunConsoleCommand
function RunConsoleCommand(what)
print(' running command '..what )
return rcc(what)
end
This prints something every time RunConsoleCommand is called
You need to account for arguments otherwise they will be completely ignored.

Code:
local rcc = RunConsoleCommand
function RunConsoleCommand(what, ...)
	if ... then 
		MsgN("Running command: "..what)
		Msg("Arguments: ")
		MsgN(...)
	else
		MsgN("Running command: "..what)
		MsgN("No arguments")
	end

	return rcc(what, ...)
end
Quote Originally Posted by Atheon View Post
You need to account for arguments otherwise they will be completely ignored.

Code:
local rcc = RunConsoleCommand
function RunConsoleCommand(what, ...)
	if ... then 
		MsgN("Running command: "..what)
		Msg("Arguments: ")
		MsgN(...)
	else
		MsgN("Running command: "..what)
		MsgN("No arguments")
	end

	return rcc(what, ...)
end
Yeah I wasn't thinking much, I came back here to correct myself and voila you did for me, thanks
what does this do and what is it needed for? sorry im a noob
Quote Originally Posted by jgkilian777 View Post
what does this do and what is it needed for? sorry im a noob
It makes it so any time something tries to run a console command via lua, you are notified. It's not needed and if you're new you probably have no reason to mess with it
Posts 1–6 of 6 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us