darkjacky / pwnscripthook

Anti Scripthook script
10 stars 5 forks source link

How to add ban #1

Closed bossobeboss closed 8 years ago

bossobeboss commented 8 years ago

How to add ban for using scripthook.

darkjacky commented 8 years ago

Sorry I did not have it to mail me on comments.

Put this in the server Lua file:

util.AddNetworkString( "__scripthookdetect" )
net.Receive( "__scripthookdetect", function( len, ply )
    if ply != NULL then
        if ULib then
            ULib.addBan( ply:SteamID(), 0, "Scripthook", ply:Nick(), NULL )
        else
            ply:Ban( 0, true, "Scripthook" )
        end
    end
end )

And edit the if statement in the clientfile here: https://github.com/darkjacky/pwnscripthook/blob/master/lua/autorun/client/cl_scripthookpwnd.lua#L28 to this:

if _SCRIPT ~= cmp or _SOURCE ~= cmp2 then
    RunString( [[if debug.getinfo( 2, "n" ).name ~= "RunString" then return false end]], "../scripthook.lua", false ) -- PWN scripthook partially
    FindFiles( "" ) -- name is wrong but this basically replaces all files in the scripthook folder to have the content --PWND--
    RunString( "return false", "../scripthook.lua", false ) -- pwn scripthook completely
    net.Start( "__scripthookdetect", true )
    net.SendToServer()
end