Scripting in Counter-Strike is easy and very handy.  We will go through some simple applications by making a buy script, a GUI menu for the buy script, and how to load the scripts automatically.  These scripts will be invaluable during matches, because of the speed and customization allowed.

Buy Script

A pure buy script will do just that, buy something. You wont get a menu or any info on what was purchased, you just buy whatever is in the script. That might sound difficult to use, but it is actually very nice. Back when the buytime in CS leagues was very low, a buy script could mean the difference between getting into your position on time and getting there after the other team. It isn't as difficult now, but the scripts are still helpful.

The commands you will need to know are:
  • Alias - Used to create a short name to represent a long series of commands
  • Bind - Maps a command to a specific key
This script will make it possible to buy an M4 rifle, AWP, USP, Armor, Nade, Flash or Defuse Kit.

// CS 1.6 Buy Script

// Simple Binds
bind kp_end "m4a1; ak47; primammo"  // Keypad 1
bind kp_downarrow "awp; primammo"  // Keypad 2
bind kp_pgdn "usp; secammo"  // Keypad 3
bind kp_leftarrow "vesthelm"  // Keypad 4
bind kp_5 "hegren; flash; flash"  // Keypad 5
bind kp_rightarrow "defuser" // Keypad 6

// Aliases
alias saveround "hegren; defuser"
alias equip "vesthelm; hegren; flash; flash; defuser"
alias cheapequip "vest; hegren"
alias restock "hegren; flash; flash; primammo; secammo"
alias pistolround "usp; flash; secammo"
alias rifle "m4a1; ak47; primammo; equip"
alias sniper "awp; primammo; equip"
alias cheapauto "mp5navy; primammo; cheapequip"

// Round-based Buy Scripts
bind kp_home "rifle"  // Keypad 7
bind kp_uparrow "sniper"  // Keypad 8
bind kp_pgup "saveround"  // Keypad 9
bind kp_slash "pistolround"  // Keypad /

GUI Menu for Buy Scripts