• Blocking certain scripts
    14 replies, posted
I wanted to know how to block a script by name, not like scriptenforcer and kicking if they have the script, GMT has this, but im not sure if its a DLL or just a fancy lua, but what i want is nothing compared to theres, i just want to block a few scripts
[QUOTE=killar456;21715153]I wanted to know how to block a script by name, not like scriptenforcer and kicking if they have the script, GMT has this, but im not sure if its a DLL or just a fancy lua, but what i want is nothing compared to theres, i just want to block a few scripts[/QUOTE] Goes in lua/autorun/server/yourfile.lua [lua] function Spawn( ply ) ply:SendLua[[if file.Find("../lua/modules/gm_sqlite") then LocalPlayer():ConCommand("quit") end]] end hook.Add( "PlayerInitialSpawn", "findfilesndc", Spawn ) [/lua]
Cubar [QUOTE=killer456] [b]not like scriptenforcer and kicking if they have the script[/b] [/QUOTE]
Thanks alot for the script example, but as ralle said, not exactly what i want GMT uses something to block scripts, i want to know if its possible with lua and how, or if its a DLL they have
GMT use scriptenforcer i think, blocking scripts by name is kind of stupid as you can use rename the script
gmt uses se 1
[QUOTE=ralle105;21723844]Cubar[/QUOTE] Oh yeah lol.
[QUOTE=Cubar;21723335]Goes in lua/autorun/server/yourfile.lua [lua] function Spawn( ply ) ply:SendLua[[if file.Find("../lua/modules/gm_sqlite") then LocalPlayer():ConCommand("quit") end]] end hook.Add( "PlayerInitialSpawn", "findfilesndc", Spawn ) [/lua][/QUOTE] AFAIK that doesn't work because "quit" is a banned command. Could just do draw.RoundedBox() on them though.
"exit" prehabs? or .. "disconnect"?
Disconnect works, but anything malicious like exit, quit and some other "close" commands are blocked. It's funny to use draw.RoundedBox() (with no args, that's how it crashes people) to get rid of assholes etc.
You can still do them using RunConsoleCommand
Really? Does that mean you can use mat_* commands?
[QUOTE=Legend286;21738365]Disconnect works, but anything malicious like exit, quit and some other "close" commands are blocked. It's funny to use draw.RoundedBox() (with no args, that's how it crashes people) to get rid of assholes etc.[/QUOTE] [lua]local oldRoundedBox = draw.RoundedBox function draw.RoundedBox(a,b,c,d,e,f) if a and b and c and d anf e and f then oldRoundedBox(a,b,c,d,e,f) end end[/lua] Crash prevented? Though I don't know if that's the optimal method or if it would impact performance.
I would make a table but is this what you are asking for? [lua] function BannedCommand(ply, args, cmd) LocalPlayer():ConCommand("quit") end concommand.Add("+aa", BannedCommand) [/lua]
actually zzaacckk, thats about perfect for what i was looking for
Sorry, you need to Log In to post a reply to this thread.