Team Fortress 2

Team Fortress 2

Not enough ratings
(Windows) How to disable sprays while keeping yours visible [TF2 / Source Engine Games]
By Zeugziumy and 1 collaborators
This guide will explain how to disable other players sprays while keeping yours visible. By default, the game also hides your spray when you disable sprays on the Advanced Options, but there's a way around that!
   
Award
Favorite
Favorited
Unfavorite
Introduction
This guide will show you two methods you can use to hide all sprays except yours. The first method, which is simpler, can be achieved in all Operational Systems (Windows, MacOS and Linux), while the second method is more complex and will be explained for Windows systems only (but may be achievable in other systems as well, although I have limited knowledge on Linux and no knowledge at all on MacOS).

The first method can be done if you are not an Administrator, while the second method may require Administrator privileges on Windows.

By default, when using the "Disable Sprays" option, your own spray will also be disabled, although other players can still see it. Don't you wish you could still see your own spray while disable other players sprays? Well, this guide is for you!
Method 1: Simple in-game script
With TF2 open, open the console (default key `, above Tab), and type this in:

bind T "cl_playerspraydisable 0; wait 90; impulse 201; wait 90; cl_playerspraydisable 1"



If you have a very low ping on a server, you can try replacing the "wait 90" instances to "wait 33", though "wait 90" is the safest option.

In case it still doesn't work (and you are sure the server does not have the sv_allow_wait_command 0 convar set, which you can check by typing sv_allow_wait_command on console and seeing what value it shows up on the drop-down list), you may want to increase "wait 90" to a larger number (the unit is measured by number of frames).

If you don't have the console activated, go to Options -> Keyboard -> Advanced and tick the "Enable developer console" option:




If you want to spray with another key that is not "T", which is the default key for sprays, just replace it with another key. You can check the names of keys on this page.

Advantages and Disadvantages of this method:
  • ( + ) Easy to do;
  • ( + ) Does not require administrator privileges;
  • ( + ) Works in Valve servers, as Valve servers allow the "wait" command;
  • ( ⎯ ) Does not work on servers that disable the "wait" command;
  • ( ⎯ ) Other player's sprays will still show up if they manage to spray during the small timeframe that "cl_playerspraydisable" was set to "0".

If the command is being reset upon changing classes or restarting TF2, you may have a config conflict somewhere on your .cfg files (such as autoexec.cfg and etc.), make sure to remove or comment (with a // at the start of the line) any instance of a "bind" command being used on the same key that you use for spraying.

Additionally, if you use the spray command alongside another command (for instance, a voice response), make sure to add the commands you normally use alongside the "cl_playerspraydisable" and "wait" commands.
Method 2 (Advanced): Denying writing access using Windows permissions options on "tf\materials\temp"
This method is a lot more complex than the first one, and most likely require administrator privileges for it to work. It also requires a few pre-requisites before doing it, as well one small caveat.

This is going to be explained only for Windows, however, it may work on MacOS and Linux via other similar methods.

First Step
Before starting, launch TF2, and make sure the "Disable Sprays" and "Delete Temporary Files During Shutdown" items are disabled on Advanced Options:


If you use a config, such as mastercomfig, make sure you do not have any option marked to disable/enable sprays, or to keep/delete the temporary files. In this case, set the "sprays" string to "keep", so it should look like: sprays=keep

Second Step
After that is done, close TF2, and delete all the files from "tf\materials\temp". This is where the game stores all the sprays from other players, as well yours. Keep in mind that you'll not lose sprays you have imported to the game by deleting these files, as your sprays are safely stored at "tf\materials\vgui\logos".

This folder stores sprays from other players, as well yours. A .vtf file is generated once the spray is sprayed onto a wall. New files are not created if it's not a new spray, though the files will be re-created if the "Delete Temporary Files During Shutdown" option is enabled.

Your "tf" folder is located at: "Steam\steamapps\common\Team Fortress 2\tf". Steam is usually installed under "Program Files", so a common path may be: "C:\Program Files\Steam\steamapps\common\Team Fortress 2\tf".

Third Step
Now, re-open TF2, create your own server (one way of doing so is typing "map mvm_example" on console) or join an empty server, and re-spray the spray (or more sprays) you wish to use in-game.

Every time you change the spray via Options -> Multiplayer, you'll have to reconnect to the server.

This step is very important as it will recreate the files to "tf\materials\temp". You'll understand later as to why we are doing this.

Once you are done respraying your stuff, check the "tf\materials\temp" folder and see if the number of files matches the amount of sprays you just re-sprayed over a wall.

Optional: If you have VTFEdit, you can open the .vtf files to check the sprays themselves.

Fourth Step
Now go to the "tf\materials\temp" folder via the File Explorer. Right-click on an empty space, and go to "Properties".


Go to the "Security" tab and select "Authenticated Users", and click "Edit...". In case you don't see "Authenticated Users" on your screen, it will also work by selecting the "Users (HostName\Users)" option, "HostName" being your PC Device name.


Select "Authenticated Users", and scroll down the list, and mark Write as "Deny", and click Apply then Yes. If you had to select "Users (HostName\Users)" instead, make sure to re-select it again on the "Permissions for temp" window, as it selects the first one of the top as the default.


It should look like this once done:


Wait... what did I just do?

This method works by denying write access to "tf/materials/temp", meaning that other player's sprays won't be able to generate/download due to write permission being denied by the system.

However, because you have manually write data of your own sprays when the folder was not set to deny writing before, your sprays will work just fine.

Fifth Step (caveat)
Because you have set to deny writing access to this folder, you won't be able to generate new sprays if you plan in importing new sprays in the future.

So, whenever you want to make new sprays, you'll have to temporarily disable the "Deny" write access to the "tf/materials/temp" folder whenever you want to import new sprays, by doing the same method as the "Fourth Step".

Once you are done importing your new sprays, then you'll have to spray them on an empty server, so they are saved properly on "tf/materials/temp". Once you are done spraying your new imported sprays, just mark the folder to "Deny" write access once again.

Advantages and Disadvantages of this method:
  • ( + ) Disable all sprays from everyone, no matter what, while yours are still visible.
  • ( + ) Works in Valve servers;
  • ( + ) Works in servers that disable the "wait" command;
  • ( ⎯ ) Requires administrator privileges;
  • ( ⎯ ) Quite annoying to import new sprays as it requires to manually set the folder to disable the "Deny" write access, then re-enabling the "Deny" write access once done.

Disclaimer:
Don't go around and mark random folders on your system to deny "Write" access or other types of permissions. You may risk your system or other applications on your computer to stop working. I'm not responsible for any problems on your computer.
Special Thanks
Asomn for trying out Method 2 with Steam Cloud enabled, and confirming it works (since I have it disabled), as well further testing on a server.
2 Comments
Zeugziumy  [author] 14 Jan, 2023 @ 6:19am 
I was just talking about this a few days ago to Asomn, lol.

But yes, that's the truth about Steam Guides. The same could be said to actual Steam game reviews that aren't meme-y.
loser baby 14 Jan, 2023 @ 12:43am 
No matter how good your guide is, still guides like "how to walk", will get 100x more attencion