1 Player screen overlay

KaydemonLP

L5: Dapper Member
Nov 17, 2015
204
63
What i mean by this is that i would like that when a player activates a trigger that that exaact player gets a overlay.

If i need to be specific id like to add the water overlay.
 

Werewolf

Probably not a real Werewolf
aa
Apr 12, 2011
873
309
It can be done via a point_clientcommand. Assuming you are using a trigger_multiple for your trigger, give it the following outputs:
Code:
OnStartTouch | [point_clientcommand] | Command | r_screenoverlay <overlay texture> | 0.00
OnStartTouch | [point_clientcommand] | Command | r_screenoverlay overlays/ | 5.00
The 2nd output will make the displayed overlay disappear by replacing it with an invalid material.

You will also need to make sure your overlay has some transparency to it so players aren't completely blinded while it's on screen, and using "UnlitGeneric" as it's not part of the physical map so won't receive any lighting info. Like so:
Code:
"UnlitGeneric"
{
   "$basetexture" "<your texture here>"
   "$translucent" "1"
}
The important thing to note here is that point_clientcommand is locked behind the 'sv_allow_point_servercommand' cvar, meaning any servers running your map will need to set the cvar to 'allow' in order for it to work.
EDIT: The 'sv_allow_point_servercommand' isn't needed as the 'r_screenoverlay' command is allowed by default.
 
Last edited:

Werewolf

Probably not a real Werewolf
aa
Apr 12, 2011
873
309
Does sv_allow_point_servercommand 0 also prevent point_clientcommands from working?
'sv_allow_point_servercommand' isn't an on/off cvar, so doesn't use 1/0 inputs. It's available inputs are:
  • "disallow" - Always disallows.
  • "official" - Allowed for valve maps only. (Default setting)
  • "always" - Allow for all maps.
But yes, that cvar controls both point_servercommand and point_clientcommand entities.
 

EmNudge

L4: Comfortable Member
Sep 23, 2015
184
60
'sv_allow_point_servercommand' isn't an on/off cvar, so doesn't use 1/0 inputs. It's available inputs are:
  • "disallow" - Always disallows.
  • "official" - Allowed for valve maps only. (Default setting)
  • "always" - Allow for all maps.
But yes, that cvar controls both point_servercommand and point_clientcommand entities.
You sure? In my experience, that command has never affected point_clientcommand entities. In fact, I just went on a map of mine which forces the player to slot3 using a point_clientcommand. I had sv_allow_point_servercommand set to never and it still switched me to slot3.

Most commands don't work with a point_clientcommand and you can find all the ones that the server can execute by typing this into console:
Code:
findflags server_can_execute
Those commands should always work, regardless of what sv_allow_point_servercommand is set to.

just a side note, a point_clientcommand will usually ignore server_can_execute if you're running the map on a listen server.
 

Werewolf

Probably not a real Werewolf
aa
Apr 12, 2011
873
309
Most commands don't work with a point_clientcommand and you can find all the ones that the server can execute by typing this into console:
Code:
findflags server_can_execute
Those commands should always work, regardless of what sv_allow_point_servercommand is set to.
I stand corrected, the cvar isn't needed. I was fairly certain that 'r_screenoverlay' would get blocked because an admin could blind players or at least obstruct their view with a malicious texture.

But for anyone else who wants to know, here's that list:
Code:
] findflags server_can_execute
"cl_soundscape_flush"
client cheat server_can_execute
- Flushes the client side soundscapes
"thirdperson"
client cheat server_can_execute
- Switch to thirdperson camera.
"firstperson"
client server_can_execute
- Switch to firstperson camera.
"playgamesound"
client server_can_execute clientcmd_can_execute
- Play a sound from the game sounds txt file
"r_screenoverlay"
client cheat server_can_execute
- Draw specified material as an overlay
"slot1"
client server_can_execute
"slot2"
client server_can_execute
"slot3"
client server_can_execute
"slot4"
client server_can_execute
"slot5"
client server_can_execute
"slot6"
client server_can_execute
"slot7"
client server_can_execute
"slot8"
client server_can_execute
"slot9"
client server_can_execute
"slot0"
client server_can_execute
"slot10"
client server_can_execute
"cancelselect"
client server_can_execute
"invnext"
client server_can_execute
"invprev"
client server_can_execute
"lastinv"
client server_can_execute
"cl_spec_mode" = "5" ( def. "1" )
client archive server_can_execute
- spectator mode
"+inspect"
client server_can_execute
"-inspect"
client server_can_execute
"slot11"
client server_can_execute
"slot12"
client server_can_execute
"play"
server_can_execute
- Play a sound.
"sndplaydelay"
server_can_execute
- Usage:  sndplaydelay delay_in_sec (negative to skip ahead) soundname
"dsp_player" = "0"
server_can_execute
"name" = "[GmT] Werewolf [GB/UK]" ( def. "unnamed" )
archive server_can_execute
- Current user name
"retry"
server_can_execute clientcmd_can_execute
- Retry connection to last server.
"redirect"
server_can_execute
- Redirect client to specified server.
"r_cleardecals"
server_can_execute clientcmd_can_execute
- Usage r_cleardecals <permanent>.
"echo"
server_can_execute
- Echo text to console.
"soundfade"
server_can_execute
- Fade client volume.
 

Fragancia

L2: Junior Member
Feb 22, 2013
91
33
Hang on, I thought r_screenoverlay was locked behind sv_cheats?
Findflags even says it's a cheat?
 

EmNudge

L4: Comfortable Member
Sep 23, 2015
184
60
Hang on, I thought r_screenoverlay was locked behind sv_cheats?
Findflags even says it's a cheat?
Yeah, it's still a cheat command. I suppose server_can_execute only shows you literally what the server can execute whether it's with cheats on or off.

I tried making a test map for it and, although it did work, console told me I needed cheats enabled. Enabling cheats got it to work. Since you can't turn on cheats without sv_allow_point_servercommand always, it's probably a no-go.
 

Fragancia

L2: Junior Member
Feb 22, 2013
91
33
I tried making a test map for it and, although it did work, console told me I needed cheats enabled. Enabling cheats got it to work. Since you can't turn on cheats without sv_allow_point_servercommand always, it's probably a no-go.

Definitely a no-go, turning on sv_cheats poses a great threat to security and any server operator worth their salt would never allow it to be enabled on their servers by anything.

The way Werewolf wrote his post in response to OP's problem made me think r_screenoverlay for some reason got available for mappers to use through some recent update which prompted me to make that previous post of mine.
 

EmNudge

L4: Comfortable Member
Sep 23, 2015
184
60
Definitely a no-go, turning on sv_cheats poses a great threat to security and any server operator worth their salt would never allow it to be enabled on their servers by anything.

The way Werewolf wrote his post in response to OP's problem made me think r_screenoverlay for some reason got available for mappers to use through some recent update which prompted me to make that previous post of mine.
You could always do the sv_cheats 1;hurtme -39429;sv_cheats 0 method. You can have the trigger enable and disable cheats fast enough that players can't abuse it. The only problem with that is that there is a microsecond window where players could spam a bind and possibly make it though.

Furthermore, the server usually prints to chat anytime a change is made which warrants a change in the server tags, as sv_cheats does.

Also, going on what I said before - thirdperson is also listed under server_can_execute, but it's a cheat command as well.
 

KaydemonLP

L5: Dapper Member
Nov 17, 2015
204
63
It can be done via a point_clientcommand. Assuming you are using a trigger_multiple for your trigger, give it the following outputs:
Code:
OnStartTouch | [point_clientcommand] | Command | r_screenoverlay <overlay texture> | 0.00
OnStartTouch | [point_clientcommand] | Command | r_screenoverlay overlays/ | 5.00
The 2nd output will make the displayed overlay disappear by replacing it with an invalid material.

You will also need to make sure your overlay has some transparency to it so players aren't completely blinded while it's on screen, and using "UnlitGeneric" as it's not part of the physical map so won't receive any lighting info. Like so:
Code:
"UnlitGeneric"
{
   "$basetexture" "<your texture here>"
   "$translucent" "1"
}
The important thing to note here is that point_clientcommand is locked behind the 'sv_allow_point_servercommand' cvar, meaning any servers running your map will need to set the cvar to 'allow' in order for it to work.
EDIT: The 'sv_allow_point_servercommand' isn't needed as the 'r_screenoverlay' command is allowed by default.
Question what should the Target be?
EDIT: Stupid question
 
Last edited:

Startacker!

WANT ME TO BE REAL? MAKE ME.
aa
Jun 15, 2013
647
1,197
!activator
 

KaydemonLP

L5: Dapper Member
Nov 17, 2015
204
63
Nope, the commands dont work unless it has sv_cheats 1