Anti-Cheat

Where does this go? I had it in the lua/autorun/server but it didn’t work. Last question I promise :stuck_out_tongue:

[lua]function anticheat (ply, cmd, args)

require(“sourcenet”)

local badcmds = { “crash_server”, “asb_options”, “+asb”, “bc_fmp”, “asb_esp”, “+aa”, “-aa”, “+makenoise”, “frotate”, “va_menu”, “aa_menu”, “at_menu”, “at_autoshoot_on”, “at_autoaim_on”, “at_esp_on”, “at_norecoil_on”, “toggle_wallers”, “jam_materials”, “toggle_xrayvision”, “aimbot_on”, “esp_on”, “FESP_TOGGLE 1”, “wots_aimbot_mouselock 0”, “FSPECTATE”}
local bantime = “30”

local function PlyFromIP( msg )
for k, v in pairs( player.GetAll() ) do
if v:IPAddress() == msg:ToBase():GetNetChannel():GetName() then
return v
end
end
end

hook.Add(“ProcessStringCmd”, “NoCmds4U”, function( msg )
for k, v in pairs( badcmds ) do
if string.find( string.lower( msg:GetCommand() ), string.lower( v ) ) then
RunConsoleCommand("sm_ban “…ply:SteamName()…” 0 Banned Command: "… v )
RunConsoleCommand(“writeid”)
PlyFromIP( msg ):Kick("Banned Command: " … v )
break
end
end
end )

end
[/lua]

You need sourcenet if you don’t have it, and yeah it goes in autorun/server

I found sourcenet, but where do I put sourcenet?

http://www.facepunch.com/showthread.php?t=888511

In the lua modules folder

OP, what the fuck have you done to my code

[editline]03:02PM[/editline]

seriously ummm why did you put it in a function

Ahhh…

And what exactly is the function for…

some people just like a lot of functions

Other then that. This is not a very good way to secure your server as putting this in console “alias a aimbot_on” would bypass it

Its shit anyway pointless as its easy as fuck to bypass anyone could do it

If you don’t know its on there and have default binds then you will get banned perma.

And most people don’t know lua and how to change a concommand.Add(“string”).