Scripting for CSS
From Tactical Wiki
Contents |
[edit] Making an autoexec.cfg file
[edit] Step One
Open notepad (Start > Program Files > Accessories > Notepad)
[edit] Step Two
Input the information you want in your autoexec file (these configurations will be set everytime you boot up Counter-Strike: Source, and anytime you run it in console via the exec autoexec command).
[edit] Step Three
Time to save what you have. (File > Save As...).
[edit] Step Four
Browse to your cfg directory, and save the file as autoexec.cfg. Refering to the picture below, ensure you have the name (autoexec.cfg) and the type (All files) selected correctly. Once you are done, hit "Save". (Your Counter-Strike: Source directory should be in the following location: C:\Program Files\Steam\SteamApps\username\counter-strike source\cstrike\cfg. If it is somewhere else, you should know how to browse to it. If not, just ask).
And there you are. Enjoy, as another side to CS:S is now avaliable to you. Make your game more personal.
[edit] Creating Walk and Crough Toggles
Just put these into your /cstrike/cfg/autoexec.cfg file. Feel free to change the bolded key to whatever you want it to be, though changing other things may render the script useless.
[edit] Walk Toggle
alias walk_togg "toggwalk_on"
alias toggwalk_on "alias walk_togg toggwalk_off; +speed"
alias toggwalk_off "alias walk_togg toggwalk_on; -speed"
bind "shift" "walk_togg"
[edit] Crouch Toggle
alias crouch_togg "toggcrouch_on"
alias toggcrouch_on "alias crouch_togg toggcrouch_off; +duck"
alias toggcrouch_off "alias crouch_togg toggcrouch_on; -duck"
bind "ctrl" "crouch_togg"
[edit] Creating Buy Binds
Now that you're in the new autoexec file, we can work on binds.
bind: Assigns a command to a key.
Syntax: bind "key" "command"
Now for the actual bind itself. Personally, I prefer to set up buy binds on my numpad, so it's out of the way and easily organized. But for simplicity's sake, I'll just use "[key]" for the key (change it to whatever you like. At the end of this post, I will have a list of the various keys possible). I will use the variable "[purchase]" for the object you are buying.
buy [key] "buy [purchase]"
You can even set up keys for multiple purchases...
buy [key] "buy [purchase1]; buy [purchase2]"
(note: when actually doing the binds, leave out the brackets. The quotes will need to stay).
[edit] Purchase Aliases
This is the name you need to use to refer to the item with. It replaces [purchase]
- alias ( gun name )
- galil ( Defender )
- ak47 ( AK-47 )
- scout ( Scout )
- sg552 ( Krieg )
- famas ( Clarion/FAMAS )
- m4a1 ( M4A1 )
- aug ( Bullpup )
- glock ( Glock )
- usp ( USP )
- p228 ( p228 )
- deagle ( Deagle )
- elite ( Dualies )
- fiveseven ( Five-Seven )
- m3 ( Shotgun )
- xm1014 ( Auto Shotgun )
- mac10 ( Ingram MAC-10 )
- tmp ( TMP )
- mp5navy ( MP5 )
- ump45 ( UMP )
- p90 ( P90 )
- m249 ( M249 )
- primammo ( Primary Ammo, Full )
- buyammo1 ( Primary Ammo, 1 Clip)
- secammo ( Secondary Ammo, Full )
- buyammo2 ( Secondary Ammo, 1 Clip)
- vest ( Kevlar )
- vesthelm ( Kevlar+Helmet )
- flashbang ( Flashbang )
- hegrenade ( HE Grenade )
- smokegrenade ( Smoke Grenade )
- nvgs ( Nightvision )
- defuser ( Defusal Kit )
[edit] Bindable Keys
Used to replace [key] All main-keyboard buttons are simply the number/letter they output (A-Z and 0-9, excluding numpad)
Numpads:
- alias ( numpad number )
- kp_end ( 1 )
- kp_downarrow ( 2 )
- kp_pgdn ( 3 )
- kp_leftarrow ( 4 )
- kp_5 ( 5 )
- kp_rightarrow ( 6 )
- kp_home ( 7 )
- kp_uparrow ( 8 )
- kp_pgup ( 9 )
Example: bind kp_5 "buy m4a1; buyammo1"
[edit] Connecting Directly
In order to create an icon that will directly connect you to TG's PCS server, you will need to edit your CSS icon on desktop to include the following information:
C:\Valve\steam\Steam.exe -applaunch 240 +connect 70.87.55.29:27015
Your regular CS will contain the non-bolded part, add the bolded part to it for a custom connect icon to server.
