Point broadcastclientcommand: Difference between revisions
Jump to navigation
Jump to search
Tip:In other VScript supported titles where this entity is not available, you can use the following entity script inside a point_clientcommand
Note:All usable commands and
(maybe overthinking rare cases but if some entities had targetname "player" they would eat the io (it would not go for player classname), and firing at point_clientcommand could fire multiple if they exist) |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{CD|CPointBroadcastClientCommand|file1=client.cpp}} | {{CD|CPointBroadcastClientCommand|file1=client.cpp}} | ||
{{this is a| | {{this is a|logical entity|name=point_broadcastclientcommand|since=Left 4 Dead}} It's an entity that issues commands to each valid client's console, as if it was typed in by that player locally. | ||
{{tip|In other [[VScript]] supported titles where this entity is not available, you can use the following [[Entity Scripts|entity script]] inside a {{ent|point_clientcommand}} | {{tip|In other [[VScript]] supported titles where this entity is not available, you can use the following [[Entity Scripts|entity script]] inside a {{ent|point_clientcommand}} | ||
<syntaxhighlight lang=js>function BroadcastCommand(command) { | <syntaxhighlight lang=js>function BroadcastCommand(command) { | ||
Line 12: | Line 12: | ||
}} | }} | ||
{{ | == Keyvalues == | ||
{{KV Targetname}} | |||
{{OtherKIO|point_clientcommand|All usable commands and}} | |||
== See also == | == See also == | ||
* {{ent|point_clientcommand}} | * {{ent|point_clientcommand}} | ||
* {{ent|point_servercommand}} | * {{ent|point_servercommand}} |
Latest revision as of 05:01, 13 May 2025
![]() |
---|
CPointBroadcastClientCommand |
![]() |
point_broadcastclientcommand
is a logical entity available in all Source games since
Left 4 Dead. It's an entity that issues commands to each valid client's console, as if it was typed in by that player locally.

function BroadcastCommand(command) {
for(local player; player = Entities.FindByClassname(player, "player"); ) {
EntFire("!self", "Command", command, 0, player);
}
}
and run the function via
clientcommand_name RunScriptCode BroadcastCommand(`console_command_here`)
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

Keyvalues / Inputs / Outputs
are same as point_clientcommand.