Point clientcommand: Difference between revisions
(→Inputs) |
(add tf2 vscript tip) |
||
Line 4: | Line 4: | ||
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. | 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. | ||
{{tip|In {{tf2}}, you can use the following entity I/O to send a client command to all players. This will not work if you have more than one point_clientcommand entity! | |||
{{code|player RunScriptCode Entities.FindByClassname(null, `point_clientcommand`).AcceptInput(`Command`, `console_command_here`, self, self)}} | |||
{{todo|This can probably be done in other [[VScript]] supported titles by using {{hammerplusplus}} and escaping the quotes into the vmf file before compiling but not confirmed. {{tf2}} supports backticks so it's not necessary here.}} | |||
}} | |||
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. | 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. |
Revision as of 06:12, 17 January 2025
![]() |
---|
CPointClientCommand |
![]() |
point_clientcommand
is a point entity available in all Source games. 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. Only 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.


player RunScriptCode Entities.FindByClassname(null, `point_clientcommand`).AcceptInput(`Command`, `console_command_here`, self, self)


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
ortarget
).
Also displayed in Hammer's 2D views and Entity Report.See also: Generic Keyvalues, Inputs and Outputs available to all entities
Inputs
- Command <string >
- Command to execute.
Bug*:In Hammer, using " symbol in parameter field will corrupt the VMF file's structure, making the file unviewable for the next Hammer session.
Fix:Remove additional " symbols manually with a text editor.
Usable ConVars/ConCommands in multiplayer



Following commands have "server_can_execute" flag.
ConCommands
Cvar/Command | Parameters or default value | Descriptor | Effect |
---|---|---|---|
echo | <string> | Echo text to console. | |
cancelselect | In ![]() |
||
firstperson | Go into firstperson view | ||
invnext | In ![]() |
||
invprev | In ![]() |
||
lastinv | Equips previously used weapon | ||
(only in ![]() |
Force weapon inspection | ||
(only in ![]() |
Cancel weapon inspection | ||
slot0 - slot10 | In ![]() |
||
(only in ![]() |
Triggers the client to perform a consistency check | ||
cl_soundscape_flush | Flushes the client side soundscapes | ||
play | <string> | <sound path> | Play a sound. |
playgamesound | <string> | <soundscript> | Play a sound from the game sounds txt file |
soundfade | <float> <float> [<float> <float>] | <percent> <hold> [<out> <int>] | Fade in/out all client volume |
sndplaydelay | <float> <string> | <delay_in_sec> <soundname> | Play a sound with a given delay. Negative to skip ahead |
(only in ![]() |
<string> [<float> <float> <float>] | <soundscript> [<x> <y> <z>] | Play sounds from the game sounds txt file at a given location |
snd_setsoundparam | <string> <volume <float 0.0-1.0> |level SNDLVL_<int 1-179>> | <soundscript> <volume <vol> |level SNDLVL_<db>> | Can change level or volume of a soundscript.
examples: snd_setsoundparam Flaregun.Detonate volume 0.1 snd_setsoundparam Flaregun.Detonate level SNDLVL_120 |
redirect | <string> | <server ip address> | Redirect client to specified server. |
retry | Retry connection to current (or last) server. | ||
rpt_connect | |||
r_cleardecals | Clear all client decals | ||
r_screenoverlay ![]() ![]() In other games, this command will only work without cheats but ONLY on dedicated servers. In ![]() SetScriptOverlayMaterial input on players instead. [todo tested in ?] |
<string> | <material name> | Draw specified material as an overlay |
ConVars
player class commands
Some commands are defined in player class and are completely hidden from auto complete. Such commands are also usable on clients connected to server via this entity