to what extent can a clientcommand control a player

EmNudge

L4: Comfortable Member
Sep 23, 2015
184
60
to what extent can the point_clientcommand control a player. it most likely can't touch or create any binds I am assuming. I know it can make the player kill himself, join a class, basic functionality.
can I, make the player join another server, perhaps?
 

Izotope

Sourcerer
aa
May 13, 2013
698
764
afaik you can do anything to a player that the player could do himself.
connect <IP> works
disconnect works
quit works (actually using that in a joke map for noclippers heh)
 

Coding Ethan

L2: Junior Member
Oct 12, 2014
93
109
does connect still work, I though they replaced it with another entity.
 

DonutVikingChap

L5: Dapper Member
Mar 15, 2013
233
139
afaik you can do anything to a player that the player could do himself.
connect <IP> works
disconnect works
quit works (actually using that in a joke map for noclippers heh)

Whoa, does that mean you could re-bind their keys, or take control over their movement with +forward, +left, etc.?
 

Izotope

Sourcerer
aa
May 13, 2013
698
764
In theory you should be able to, haven't tested it, though.
 

EmNudge

L4: Comfortable Member
Sep 23, 2015
184
60
Whoa, does that mean you could re-bind their keys, or take control over their movement with +forward, +left, etc.?
yeah, thats what I was asking. I hope not, I really do.
I don't want to go on a map to find that all my keys have been binded to chat commands of racial slurs on every server from then on
(until I reload my autoexe that is)

we could probably do an unbindall and then close the console, do some other stuff, forcing the guy to shut off his computer and manually turn binds back to default.
or just make them type _restart to restart tf2 automatically.
 
Last edited:

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,257
999
This might help you. Type the emboldened text in to console.

Note you will get a reduced amount if you do this on a SRCDS server (TF2 server) rather than a game client. I take it to mean that servers can't do much. Though I have been able to get the client to execute voice commands in the past, jump and crouch, but the latter two were unreliable. The preferred method of getting a player character to speak is using logic and SpeakResponseConcept.

findflags clientcmd_can_execute

"replay_reloadbrowser"
client clientcmd_can_execute
- Reloads replay data and display replay browser
"spec_autodirector" = "1"
client clientcmd_can_execute
- Auto-director chooses best view modes while spectating
"joyadvancedupdate"
client clientcmd_can_execute
"playgamesound"
client server_can_execute clientcmd_can_execute
- Play a sound from the game sounds txt file
"voice_modenable" = "1"
client archive clientcmd_can_execute
- Enable/disable voice in this mod.
"overview_health" = "1"
client archive clientcmd_can_execute
- Show player's health in map overview.

"overview_names" = "1"
client archive clientcmd_can_execute
- Show player's names in map overview.

"overview_tracks" = "1"
client archive clientcmd_can_execute
- Show player's tracks in map overview.

"overview_locked" = "1"
client archive clientcmd_can_execute
- Locks map angle, doesn't follow view angle.

"overview_alpha" = "1.0"
client archive clientcmd_can_execute
- Overview map translucency.

"spec_next"
client clientcmd_can_execute
- Spectate next player
"spec_prev"
client clientcmd_can_execute
- Spectate previous player
"spec_mode"
client clientcmd_can_execute
- Set spectator mode
"spec_player"
client clientcmd_can_execute
- Spectate player by name
"resetplayerstats"
client clientcmd_can_execute
"retry"
server_can_execute clientcmd_can_execute
- Retry connection to last server.
"screenshot"
clientcmd_can_execute
- Take a screenshot.
"setinfo"
clientcmd_can_execute
- Adds a new user info value
"r_cleardecals"
server_can_execute clientcmd_can_execute
- Usage r_cleardecals <permanent>.
"escape"
clientcmd_can_execute
- Escape key pressed.



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" = "6" ( 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" = "worMatty ⛧" ( 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.
 

EmNudge

L4: Comfortable Member
Sep 23, 2015
184
60
This might help you. Type the emboldened text in to console.

Note you will get a reduced amount if you do this on a SRCDS server (TF2 server) rather than a game client. I take it to mean that servers can't do much. Though I have been able to get the client to execute voice commands in the past, jump and crouch, but the latter two were unreliable. The preferred method of getting a player character to speak is using logic and SpeakResponseConcept.
I don't believe this covers everything.
proof: I am easily able to force a client to join a class or team, but those commands aren't included in the list.
 
Last edited:

henke37

aa
Sep 23, 2011
2,075
515
You mean "aren't".
 

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,257
999
You may find that you are unable to force a client to join a team if you run the map on a dedicated Source server, as opposed to a listen server run in the game itself. I did some research last night and found complaints that the clientcommand join method no longer worked. I can't guarantee the information above is correct but I thought it was interesting.
 

EmNudge

L4: Comfortable Member
Sep 23, 2015
184
60
You may find that you are unable to force a client to join a team if you run the map on a dedicated Source server, as opposed to a listen server run in the game itself. I did some research last night and found complaints that the clientcommand join method no longer worked. I can't guarantee the information above is correct but I thought it was interesting.
oh....well that kinda sucks for me.
so are we to say that all commands should work in a listen server, but not in a dedicated server?

I was using the join class command to force a player to spy in a room meant for only spy...don't know how I am going to accomplish that now.

thanks though
 

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,257
999
My advice is try it out. If you have access to a server, do that, or ask someone who does. Perhaps make a test map and ask someone to upload it to TF2maps and change to it on one of the servers.

There was a new filter entity that came about in the game along with Gun Mettle, I think. It seems to be for TF2 class filtering. It's called filter_tf_class. It has one property named tfclass and its value should be a single number. That number is representative of one of the TF2 classes, like so:
  1. Scout
  2. Sniper
  3. Soldier
  4. Demoman
  5. Medic
  6. Heavy
  7. Pyro
  8. Spy
  9. Engineer
You might be able to use this in conjunction with a trigger_teleport or something to prevent any non-spies from entering an area. The entity is not part of the default TF2 FGD so you will have to manually type it in and add its properties. You are probably best creating an existing filter entity and going from there.

I haven't tested this new entity yet myself and haven't heard any reports of its usefulness.