Hi all,
I have been doing a bit of research tonight to write my own buy script. Thought I would post up the information I put together for you all to use should you be in need of a script but never got around to it.
Theres 4 elements to this. 1) The creation of the config file where you save these commands. 2 - The labels for each gun and item you can buy. 3 - the labels for many of the keys on your keyboard and 4 - The
command to associate a particular key being pressed with particular items being bought.
1) autoexec.cfg
Firstly, open a windows explorer window and go to:
C:\Program Files\Valve\Steam\SteamApps\<STEAM ACCOUNT NAME>\counter-strike source\cstrike\cfg
Right click the white space in that folder and select new, then select Text Document. Rename it to autoexec.cfg.
Click on it and if necessary, Windows will ask you what program you want to use to open it. Tell it to use notepad.
With autoexec.cfg open, you can now begin to write your binds using the information below.
2) Weapon & Equipment label list
Assualt Rifles:
galil - IDF Defender
ak47 - CV-47
sg552 - Krieg 552
g3sg1 - D3/AU1
famas - Clarion 5.56
m4a1 - Maverick M4A1 Carbine
aug - Bullpup
sg550 - Krieg 550 Commando
m249 - M249 (Para, the big machine gun)
Sniper rifles
awp - Magnum Sniper Rifle
scout - Schmidt Scout
Pistols
glock - 9x19mm Sidearm
usp - KM .45 Tactical
p228 - 228 Compact
deagle - Night Hawk .50C
elite - .40 Dual Elites
fiveseven - ES Five-Seven
Shotguns
m3 - Leone 12 Gauge Super
xm1014 - Leone YG1265 Auto Shotgun
Sub-machine guns
mac10 - Ingram MAC-10
tmp - Schmidt Machine Pistol
mp5navy - KM Sub-Machine Gun
ump45 - KM UMP45
p90 - ES C90
Ammo
I have included these incase Valve ever change it back to the old system of you buying your ammo instead of it being replenished automatically, for free.
primammo - Primary Ammo
secammo - Secondary Ammo
Equipment
vest - Kevlar
vesthelm - Kevlar+Helmet
flashbang - Flashbang
hegrenade - HE Grenade
smokegrenade - Smoke Grenade
nvgs - Nightvision
defuser - Defusal Kit
3) Keypad label list
bind "F1" ~ bind "F12"
Please note: The F1, F2 ect keys are not to be bound and used for purchasing the AWP, as it gets around the one AWP per team limiting software.
If you are suspected of using this method to acquire the AWP against server rules, you will be asked to:
- move to spectator within the game,
- minimise the game and connect to the FF$ IRC channel.
- the admin directing you will ask to be sent your config.cfg and autoexec.cfg files.
- Your binds will be inspected and if you are found to have bound a function key to buying the AWP, it will be up to the admins discretion what your punishment may be. This can include a permanent ban.
- Disconnecting from the server or refusing to co-operate, even if you later present yourself in IRC; will be treated as evidence of guilt.
You have been warned!
bind "["
bind "]"
bind "home"
bind "pgup"
bind "pgdn"
bind "del"
bind "end"
bind "uparrow"
bind "downarrow"
bind "leftarrow"
bind "rightarrow"
bind "kp_end" (1 on the keypad)
bind "kp_downarrow" (2 on the keypad)
bind "kp_pgdn" (3)
bind "kp_leftarrow" (4)
bind "kp_5"
bind "kp_rightarrow" (6)
bind "kp_home" (7)
bind "kp_uparrow" (8)
bind "kp_pgup" (9)
bind "kp_ins" (0 / insert, bottom left ussualy)
bind "kp_enter" (Enter)
bind "kp_del" (keybad delete / . )
bind "kp_slash" (/)
bind "kp_minus" (-)
bind "kp_plus" (+)
I can't find the label for the star symbol on the keypad. If you know it, please post it.
4) Binding commands to a key
The basic syntax is:
bind "<key>" "buy <weapon label>"
Example:
bind "F1" "buy USP"
For multiple purchases with one key:
bind "F2" "buy vesthelm; buy m4a1; buy ak47"
Note that in the above example, a ; symbol seperates each buy instruction but that the word buy is needed each time. Open and close the whole statement with ".
Also notice that I have put instructions for both the M4 and the AK. When you press the button and the game runs the command, if an M4 can't be purchased (because your a terrorist), obviously you wont receive one. But it will go to the next instruction and if you have enough money for the item, it will buy it. Likewise if your a CT, it will process the M4 instruction, but skip the AK one.
Other instructions you can write are not limited to buying items, but presumably every instruction available in the console.
Examples:
bind "F1" "say timeleft"
bind "F2" "say_team Bomb at my position!"
bind "F3" "name Schnapps"
bind "F4" "name FF$ | Schnapps"
You can also write comments in your autoexec.cfg file for future reference.
// comment
I am still playing around with my config but upon request, I'll be happy to upload it.
Enjoy!