How to prevent a player from using console command?
7 replies, posted
Hi I have a problem, the problem is that when player type noclip in the console command he will noclip and that cheat, so I wounder is it a way to hide those console commands or something?
From [URL="http://wiki.garrysmod.com/page/GM/PlayerNoClip"]the wiki page[/URL]:
[code]
local function DisableNoclip( ply )
return ply:IsAdmin()
end
hook.Add( "PlayerNoClip", "DisableNoclip", DisableNoclip )[/code]
To answer your question directly, I do not believe it is possible to block console commands which are created and defined inside of the C++ scope.
Turn off noclip?
[editline]16th August 2013[/editline]
It would be kind of useful to know what gamemode this is.
[QUOTE=Darkwater124;41861459]Turn off noclip?
[editline]16th August 2013[/editline]
It would be kind of useful to know what gamemode this is.[/QUOTE]
When a player dies it runs a console command "spectate", but when a player is alive he type in the console spectate then he can noclip, then he tupe unspectate so he returns to normal again and that cheat.
[editline]16th August 2013[/editline]
But can't you hide the command in the console? So they don't know what the console command is
[QUOTE=LeonCrop;41861810]When a player dies it runs a console command "spectate", but when a player is alive he type in the console spectate then he can noclip, then he tupe unspectate so he returns to normal again and that cheat.[/QUOTE]
That sounds like a bug, I guess you could file it as one [url=http://facepunch.com/forums/414]here[/url]. A workaround could be unnoclipping the player when he spawns.
I think I can solve this if there is a code that can run a lua file
Assuming "spectate" is a custom command, just add an alive check to it before setting the movetype.
Sorry, you need to Log In to post a reply to this thread.