How to check commands server is executing on client?
2 replies, posted
Hey, I'm curious if there is any command or way to check the commands a server is executing on you. ex: you interact with an npc, and buy something from him. the console would then echo what command the server ran on you in order to buy that item
thanks.
You want to run code on the 'client' side, most servers block clientside files.
If you find a server with sv_allowcslua 1 (or use a bypass) then you can run your own script.
You could do something like this (just the idea, not guaranteed to copy-paste ok)
[lua]
local originalFunction = RunConsoleCommand
RunConsoleCommand = function(cmd, ...)
print("A command was run. The command was "..cmd)
print("The arguments were:")
PrintTable({...})
originalFunction( cmd, ... )
end
[/lua]
That overrides the original RunConsoleCommand() function with a new function that prints the info it was passed and then calls the original command.
There are a variety of ways the server can 'run' a command on you so you would need to override other functions such as net.Incoming and/or ply:ConCommand, but this should give you the idea of how to do it.
Thanks much apprecaited!
Sorry, you need to Log In to post a reply to this thread.