Client Command by trigger_proximity
![]() |
This article needs to be cleaned up to conform to a higher standard of quality.
|
![]() |
This page is a candidate for speedy deletion. If you disagree with its speedy deletion, please explain why on its talk page. If this page obviously does not meet the criteria for speedy deletion, or you intend to fix it, please remove this notice, but do not remove this notice from articles that you have created yourself.
|
Sometimes, either for testing or gameplay purposes, you may need the client (player(s) on your map) to execute a console command. This tutorial explains how to make a console command which executes on the start of every round in CS:S and makes a single CT activate his flashlight. If you want things to be used multiple times, read at the end of this tutorial what you need to do.
Contents
Entity requirements
- Player spawn. e.g. info_player_start, info_player_counterterrorist, info_player_terrorist, etc.
- Trigger_proximity
- Point_clientcommand
- Logic_auto
- Information about client commands: Command, Console Command List, and Impulse
Tutorial
Setting up the point_clientcommand
![]() Setting up the trigger_proximity
Setting up the logic_auto
![]() |
Multiple ...
Triggers
For more triggers, like described in this tutorial, copy the point_clientcommand and the trigger_proximity. Rename them both to make sure they are only related to each other. Now place them at more player spawns.
Player # | Name point_clientcommand | Name Trigger_proximity | Output Trigger_proximity |
---|---|---|---|
Player 1 | clientcommand | triggerprox_1 | clientcommand|Command|impulse 100|0.20|signed |
Player 2 | clientcommand | triggerprox_2 | clientcommand|Command|impulse 100|0.20|signed |
etc.
Leave the logic_auto as it is, since it will automatically search for more triggerprox_ prefixes because of the wildcard (*).The clientcommand is still the same, because it will just execute the Client Command and does nothing else.
Commands
For multiple commands at a time, add more outputs to the trigger_proximity-entity:
My output | Target entity | Target input | Parameter | Delay | Only once | Comments | ||
![]() |
OnUser1 | clientcommand | Command | impulse 100 | 0.20 | signed | Active the flashlight on Client's side | |
![]() |
OnUser1 | clientcommand | Command | jpeg | 0.00 | signed | Create a screenshot on Client's side | |

Tips for commands
For this tutorial, a flashlight (impulse 100) was used as a command. There are many others that come in handy. Feel free to add your own suggestions (including the Console Command, circumstances):
Command | What does it do | Circumstances / Examples |
---|---|---|
impulse 100 |
Toggles flashlight | Dark maps |
bind "F12" "<command>" |
Binds a key for a command | Binding a key to a certain command (only useful in Single Player). |
alias oneclick "+attack; wait; wait; -attack" |
Creates a command that makes automatic weapons into one shot weapons. Once this command has been executed, use another command to bind mouse1 to oneclick | Can be used to make using an assault rifle or machine gun more challenging (use in singleplayer for best results) |

ent_fire <ent_name> <message>
) requires double quotes. This will crash Hammer next time you load the level, as Hammer uses double quotes to separate parts of messages. Currently the only way around this(to my knowledge) is to use double quotes when compiling, which will work fine, but when exiting Hammer change the double quotes to single quotes(then save). Next time you load the map, remember to change them back to double quotes.Sample map
sdk_client_command_start_round__by_CrabbyData.vmf
(13,3 kB)
Download mirrors:
- Mirror 1 From CrabbyData's site
- Mirror 2 RapidShare.com
- Mirror 3 Badongo.com (complete the CAPTCHA on the right side of the page and click 'Download Your File Here')