Point clientcommand: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(-added cvars with server_can_execute)
(-r_screenoverlay notice)
Line 29: Line 29:
{{varcom|play|cmd||Play a sound.}}
{{varcom|play|cmd||Play a sound.}}
{{varcom|playgamesound|cmd||Play a sound from the game sounds txt file}}
{{varcom|playgamesound|cmd||Play a sound from the game sounds txt file}}
{{varcom|r_screenoverlay|cmd||Draw specified material as an overlay}}
{{varcom|r_screenoverlay {{bug|Also has cheat flag and cannot be used in {{l4d2}}<br>{{todo|confirm other games}}}}|cmd||Draw specified material as an overlay}}
{{varcom|retry|cmd||Retry connection to last server.}}
{{varcom|retry|cmd||Retry connection to last server.}}
{{varcom|rpt_connect|cmd||}}
{{varcom|rpt_connect|cmd||}}

Revision as of 12:26, 22 November 2022

C++ Class hierarchy
CPointClientCommand
CPointEntity
CBaseEntity
C++ client.cpp

Template:Base point It issues commands to the client console as if they were typed manually by the player. The client commands are sent as parameters of the Command input. One instance of the entity is ever needed in a map.


In multiplayer games, the commands are only executed on the Activator's client. If the activator was not a player, then it simply won't do anything (unless it's in commentary mode; then the command will be executed from the first player). If you require all players to execute the command, use the point_broadcastclientcommand entity instead.

This command (in conjunction with point_servercommand and the config (cfg) file) used to allow a client to cheat on multiplayer servers through changing player names, execute client commands, and other things. On multiplayer servers, any command that DOES NOT HAVE the FCVAR_SERVER_CAN_EXECUTE flag set cannot be executed by this entity; any attempt will be reported and blocked.

Keyvalues

Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Inputs

Command <stringRedirectInput/string>
Command to execute.
Icon-Bug.pngBug:In Hammer, using " symbol in parameter field will corrupt the VMF file's structure, making the file unviewable for the next Hammer session.  [todo tested in ?]
Note.pngFix:Remove the string argument manually with a text editor.

Usable ConVars/ConCommands

Note.pngNote:Only Left 4 Dead 2 cvar list was considered

Following commands have "server_can_execute" flag.

ConCommands

Cvar/Command Parameters or default value Descriptor Effect
cancelselect cmd
cl_consistencycheck cmd Triggers the client to perform a consistency check
cl_soundscape_flush cmd Flushes the client side soundscapes
echo cmd Echo text to console.
invnext cmd
invprev cmd
lastinv cmd
play cmd Play a sound.
playgamesound cmd Play a sound from the game sounds txt file
r_screenoverlay
Icon-Bug.pngBug:Also has cheat flag and cannot be used in Left 4 Dead 2
Todo: confirm other games
  [todo tested in ?]
cmd Draw specified material as an overlay
retry cmd Retry connection to last server.
rpt_connect cmd
slot0 cmd
slot1 cmd
slot10 cmd
slot2 cmd
slot3 cmd
slot4 cmd
slot5 cmd
slot6 cmd
slot7 cmd
slot8 cmd
slot9 cmd
snd_playsounds cmd Play sounds from the game sounds txt file at a given location
snd_setsoundparam cmd Set a sound paramater

ConVars

Cvar/Command Parameters or default value Descriptor Effect
cl_ideal_spec_mode 5 desired spectator mode (4 = in-eye, 5 = chase, 6 = roaming)
cl_session
dsp_player 0
name step Current user name
name2 unnamed Current user name

See also