How to setup pure server (sv_pure) with ClientMod to prevent Materials Wallhack ?


Staff member
In this tutorial, I will explain how to properly setup sv_pure on your server with ClientMod. Let's first understand what exactly is sv_pure or pure server !

If sv_pure is enabled on a server, then the server forces clients to use only files matching with server. This means, any custom files used for modifying texture, sound of the map will be simply ignored. Thus preventing clients to use certain cheats such as Materials Wallhack.

By default sv_pure is set to 0, means disabled. The sv_pure cvar supports 3 values :
  • 0 - Disabled setting for sv_pure. Custom files from client is supported on the server.
  • 1 - sv_pure is enabled on server. Any custom files to modify the original game files is not allowed. This setting supports a whitelist file pure_server_whitelist.txt, in which server owners can allow certain custom files to be used by the clients such as skins, sprays, server plugin files etc.
  • 2 - sv_pure is enabled on server. For this setting, no whitelist file is loaded or read by the server. This setting doesn't allow any modified custom file including server plugins custom files. Everything is ignored except the default files of the server and client.
Before the ClientMod API, the sv_pure was broken on CS: Source v34 servers. ClientMod API fixes this bug, so now server owners can use the sv_pure setting on their server.

Requirements :
  • Install ClientMod Server API on server.
  • In cstrike/cfg/sourcemod/ClientMod.cfg, set the value of the CVAR se_allowpure to 1.
  • In cstrike/cfg/autoexec.cfg, put the cvar sv_pure. Use value 1 or 2, depending on what type of sv_pure setting you want. It is necessary to have the sv_pure cvar in autoexec.cfg. Because on server start or map change, this file is loaded first, after that server.cfg file or any other map config file. If sv_pure is set on server.cfg instead of autoexec.cfg, then on server start first map doesn't load with sv_pure setting and some clients game may crash. It will only take effect after the map change. Make sure no other cfg file contains sv_pure cvar, otherwise it may not work for you.
Setting Up The Pure Server Whitelist :

Configuring the whitelist for sv_pure server is only required, if you are running your server with sv_pure "1". If you are running server with sv_pure "2", you may skip this step.

The whitelist is a text file (pure_server_whitelist.txt) in which we can configure, some custom files to be allowed on server. After configuring, put this file in cstrike folder directly and restart the server. Below is an example pure_server_whitelist.txt file, you can refer to this file for configuring the whitelist. If you do not understand anything, feel free to leave a comment below.

    // Note : You can add allowed files path according to your preferences below. It all depends on what you want to allow on your server.
    // If you read this file correctly, you may get it right at first attempt.

    // Do not modify these 3 lines. These 3 lines denote that, we must allow original valve game files.

    materials\...    from_steam
    models\...    from_steam
    sound\...    from_steam

    // You can modify this file after this line.

    // List of client side files path or files allowed on server                                                                                       //
    // Only mention exact folder/files which you want to allow for players                                                                             //
    // Files which are not mentioned here and if client is using them, they will be unable to see their custom files on server                         //
    // Below are list of files allowed on Republic Indian Server. Modify it as per your requirement                                                    //
    // The commented lines (//) are commented intentionally as an example, uncomment (remove //) the line if you want your clients to use those files  //

    // Allow client side players skin
    // If you don't want to allow client side players skins, then remove these 2 lines or add // in front of them
    models\player\...    allow_from_disk
    materials\models\player\...    allow_from_disk

    // Allow client side radio sounds (remove // to allow)
    // sound\radio\...    allow_from_disk

    // Allow client side Weapons Skins
    // If you don't want to allow client side weapon skins, then remove these 4 lines or add // in front of them
    models\weapons\...    allow_from_disk
    materials\models\weapons\...    allow_from_disk
    scripts\weapons\...    allow_from_disk
    sound\weapons\...    allow_from_disk

    // Allow Weapons shell materials models.
    // These files can be used for custom weapon muzzleflash or shell animation or model
    // Remove these 2 lines to disallow or add // in front of them
    models\Shells\...    allow_from_disk
    materials\models\Shells\...    allow_from_disk

    // Allow Client Side Hostage Skins
    // If you want to allow client side hostage skins. Then remove // from below 4 lines
    //models\Characters\...    allow_from_disk
    //materials\models\hostages\...    allow_from_disk
    //materials\models\Humans\...    allow_from_disk
    //sound\hostage\...    allow_from_disk

    // Allow Map Custom radar overview file
    // This file is used for custom radar on the map
    // If you don't want to allow, then remove this line or add // in front of it
    materials\overviews\...    allow_from_disk

    // Allow custom buy menu
    // To disallow custom buy menu, remove below 2 lines or add // in front of them
    materials\VGUI\gfx\VGUI\...    allow_from_disk
    sound\items\...    allow_from_disk

    // Allow custom muzzleflash effect of weapons
    // To disallow custom muzzleflash effect, remove below lines or add // in front of them
    materials\effects\muzzleflash1.vmt    allow_from_disk
    materials\effects\muzzleflash3.vmt    allow_from_disk
    materials\effects\muzzleflash2.vmt    allow_from_disk
    materials\effects\muzzleflash4.vmt    allow_from_disk
    materials\effects\muzzleflashX.vmt    allow_from_disk
    materials\effects\muzzleflash1.vtf    allow_from_disk
    materials\effects\muzzleflash3.vtf    allow_from_disk
    materials\effects\muzzleflash2.vtf    allow_from_disk
    materials\effects\muzzleflash4.vtf    allow_from_disk
    materials\effects\muzzleflashX.vtf    allow_from_disk

    // Allow custom spray
    // To disallow custom spray, remove below 2 lines or add // in front of them
    materials\temp\...    allow_from_disk
    materials\vgui\...    allow_from_disk

    // Allow players avatars in replay
    materials\vgui\replay\thumbnails\...    allow_from_disk

    // Note: If you know the exact files which you want to allow for the client
    // Make an additional check on those files known as CRC Check
    // This will make sure that client under no circumstances can modify that file and the file should match exactly with the server
    // Do not use check_crc with too many files as this will lag your server like hell
    // Example :
    // materials\metal\metalwall046a.vmt    allow_from_disk+check_crc

    // Now here we allow all the sourcemod plugins related files which client downloaded from the server
    // If you don't allow these files, the client will not be able to experience the sound, materials, effects etc you have put on the server
    // These files are of Republic Indian Server sourcemod plugins
    // Modify according to your server files

    // Sounds from plugins
    sound\vertigo\...    allow_from_disk

    // Custom Maps
    maps\...    allow_from_disk

    // Custom materials from plugins
    materials\ggwp\...    allow_from_disk
    materials\models\parachute\...    allow_from_disk
    materials\paintball\...    allow_from_disk
    materials\skybox\...    allow_from_disk
    materials\sprites\trails\...    allow_from_disk
    materials\kphostingbanner.vmt    allow_from_disk
    materials\kphostingbanner.vtf    allow_from_disk

    // Custom models from plugins
    models\parachute\...    allow_from_disk

// If set to 1, the server will kick clients with mismatching files. Otherwise, it will issue a warning to the client.
"sv_pure_kick_clients" = "0"


Last edited:
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features of our website. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock