Counter-Strike 2

Counter-Strike 2

Not enough ratings
Stop noclip in your map
By Keplyx
This guide will show you how to stop a player from nocliping in your map. This is very easy and useful if you are making maps that require cheats enabled.

It will be illustrated with a demo map you can download as a .bsp and a .vmf (see the download section).

We will use a vscript I made, all I ask is if you use it in your map, please put a link to this guide in the description.

Anyway, lets start!
   
Award
Favorite
Favorited
Unfavorite
What we are gonna do
We are gonna use a script which checks if the player is nocliping. If so, it will tp him to the origin of the map (0, 0, 0). Just make a jail at those coordinates saying he's not a good boy!

First, you will need to download the script, put it in the right folder, setup hammer, and pack it in your map.

This will allow you to be sure the player cannot cheat by going through walls in your map with sv_cheats 1.

You can download the demo map on workshop to test the script here
"Install" the script
Download the script: (remove space after "mega.nz")
mega.nz /#!QlcTxAaJ!DDVaRgg6b1cyNHb8q0UU8R3Q27HlQamdt1AZp1n3Rh0

You should have downloaded a file called stopnoclip.nut. Open it if you want to see details on how it works, the script is commented to help you understand.

Now, move this script in your csgo/scripts/vscripts folder.

You can now use it in hammer!
Use the script in Hammer
Download the demo map as a .vmf: (remove space after "mega.nz")
mega.nz /#!QtESWLoK!XbrhEPbDtf3qSgw1RCitwS4EUBuTueatd_5BMTSMBM4

  • In hammer, create a new logic_script entity. Open it's properties.

  • Under Entity script, enter the script's path relative to the folder csgo/scripts/vscripts.
    (For example, it will be stopnoclip.nut if you simply put it in the vscript folder, and it will be utils/stopnoclip.nut if you put it in a folder named utils in the vscript folder)

    Or you can simply click on manage, "+", and select the script.
  • Finally, under Script think function, enter Think.



There you go, players can't noclip anymore in your map!
Pack the script
See this guide on how to pack your vscript into your map

This is really important, you will need to do this each time you want to update your map!
Downloads
Remove space after "mega.nz" (steam is removing link otherwise)

-The script:
mega.nz /#!QlcTxAaJ!DDVaRgg6b1cyNHb8q0UU8R3Q27HlQamdt1AZp1n3Rh0
-The demo map (.vmf):
mega.nz /#!QtESWLoK!XbrhEPbDtf3qSgw1RCitwS4EUBuTueatd_5BMTSMBM4
-The demo map in workshop
10 Comments
BaLTa$aR 12 Oct, 2020 @ 3:45pm 
Can you make a simple script which turns off sv_cheats if someone turns it on?
Furiosa 14 Oct, 2018 @ 12:23pm 
lol gg
Keplyx  [author] 12 Oct, 2018 @ 12:58pm 
shhhh nobody knows about this command :)
Good point tho, didn't think about that.
ileryon 11 Oct, 2018 @ 12:59pm 
ent_remove_all logic_script?
Furiosa 10 Nov, 2016 @ 10:40pm 
Useful for my single player map later, soon like valve time :steammocking:
Keplyx  [author] 9 Nov, 2016 @ 9:42pm 
Well, that tutorial was a request, some people may find it useful
Flygoow 5 Nov, 2016 @ 10:21am 
Nickel
Keplyx  [author] 5 Nov, 2016 @ 6:26am 
thanks, I can't check if players use this command, but yeah, if someone's nocliping, I can set r_drawothermodels 0
Furiosa 5 Nov, 2016 @ 6:25am 
Can it also disable command like r_drawothermodels 2 to see other player? :steambored:

Nice guide :steammocking:
badtRIP ☣ 5 Nov, 2016 @ 6:23am 
ty again for all help bro !