1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Come and join our gamer community by registering for free here

How to make a CS: Source Buy Script

Discussion in 'Counterstrike CZ/CS/CSS/GO Forum' started by Ind3lible, Dec 7, 2004.

  1. Ind3lible

    Ind3lible New Member

    Jul 8, 2003
    Likes Received:
    Trophy Points:
    * Setup *
    First, we'll need to make an autoexec for your buy scripts to go in.

    Open up the C:\Valve\Steam\SteamApps\youremail\counter-strike source\cstrike\cfg folder
    Right-click anywhere in the folder, from the pop-up menu go to New >>> Text Document
    *** I recommend using Notepad for editing / creating config files to prevent any possible problems ***

    Open up the New Text Document and go to File >>> Save As

    For the File name: "autoexec.cfg"
    For the Save as type: All Files
    For the Encoding: ANSI
    Once it's saved it will create a new document called autoexec.cfg, this is where you will enter in your commands.

    * Entering Commands *
    Buy Scripting in Source is very similar to 1.6/CZ except that you need to add "buy" before whichever weapon or item you are going to purchase. Other than that, it's pretty much the same, so here we go.

    First type which key that you want to bind (for this example we will use f1)...

    bind f1
    Now, decide which weapon you would like f1 to buy, we'll use the AK-47:

    bind f1 "buy ak47"
    And that's it...of course there's more things you can add such as buying Primary Ammo, Kevlar, Grenades, etc. So we'll do one so that we buy an AK-47, Primary Ammo, Kevlar, and a HE grenade:

    bind f1 "buy ak47; buy primammo; buy vest; buy hegrenade"
    You can also combine 2 different team specific weapons into the same binds. Like the AK-47 and M4A1:

    bind f1 "buy ak47; buy m4a1; buy primammo; buy vest; buy hegrenade"
    That's all there is to it...of course you'll need to know the names of what weapons you want to buy in order to put them in your script...

    * Weapon Bind Names *
    Here is the list of the weapons and equipment you can buy and their proper bind name...also note that these are the real weapon names and not the fake VGUI weapon names just in case you're wondering why they're listed differently here.
    Glock G18 Select Fire - glock
    HK USP .45 Tactical - usp
    Sig P228 - p228
    Desert Eagle - deagle
    FN Five-seveN - fiveseven
    Dual Beretta 96G Elite - elite
    Benelli M3 Super90 - m3
    Benelli XM1014 - xm1014
    Submachine Guns:
    Steyr Tactical Machine Pistol - tmp
    Ingram MAC-10 - mac10
    HK MP5-Navy - mp5navy
    HK UMP45 - ump45
    FN P90 - p90
    Assault Rifles:
    IMI Galil - galil
    FA MAS - famas
    AK-47 - ak47
    Colt M4A1 Carbine - m4a1
    Sig SG 552 Commando - sg552
    Steyr AUG - aug
    Sniper Rifles:
    Steyr Scout - scout
    Sig SG 550 Sniper - sg550
    AI Arctic Warfare/Magnum - awp
    HK G3/SG-1 Sniper Rifle - g3sg1
    Machine Gun:
    FN M249 Para - m249
    Primary Ammo - primammo
    Secondary Ammo - secammo
    Kevlar Vest - vest
    Kevlar Vest & Helmet - vesthelm
    Flashbang - flashbang
    HE Grenade - hegrenade
    Smoke Grenade - smokegrenade
    Defuse Kit - defuser
    NightVision Goggles - nvgs
    * Key Bind Names *
    Here is the list of the keyboard keys you can bind and their proper bind name...also note that these are from 1.6 but I don't think that they've been changed in CS:S.
    Keyboard Key - Key Bind Name
    Space Bar - space
    Caps Lock - capslock
    Escape - escape
    F1 - f1
    F2 - f2
    F3 - f3
    F4 - f4
    F5 - f5
    F6 - f6
    F7 - f7
    F8 - f8
    F9 - f9
    F10 - f10
    F11 - f11
    F12 - f12
    Pause - pause
    Left Quote - `
    Hyphen - -
    Equals Sign - =
    Backspace - backspace
    Tab Key - tab
    Left Bracket - ]
    Right Bracket - [
    Forward Slash - \
    Semicolon - semicolon
    Right Quote - '
    Back Slash - /
    Shift Key - shift
    Enter - enter
    Comma - ,
    Control - ctrl
    Alt - alt
    One - 1
    Two - 2
    Three - 3
    Four - 4
    Five - 5
    Six - 6
    Seven - 7
    Eight - 8
    Nine - 9
    Zero - 0
    A - a
    B - b
    C - c
    D - d
    E - e
    F - f
    G - g
    H - h
    I - i
    J - j
    K - k
    L - l
    M - m
    N - n
    O - o
    P - p
    Q - q
    R - r
    S - s
    T - t
    U - u
    V - v
    W - w
    X - x
    Y - y
    Z - z
    Up Arrow - uparrow
    Down Arrow - downarrow
    Right Arrow - rightarrow
    Left Arrow - leftarrow
    Insert - ins
    Home - home
    Page Up - pgup
    Page Down - pgdown
    Delete - del
    End - end
    Mouse Button 1 - mouse1
    Mouse Button 2 - mouse2
    Mouse Button 3 - mouse3
    Mouse Button 4 - mouse4
    Mouse Button 5 - mouse5
    Mouse Wheel Up - mwheelup
    Mouse Wheel Down - mwheeldown
    Keypad Key - Key Bind Name
    1 - kp_end
    2 - kp_downarrow
    3 - kp_pgdn
    4 - kp_leftarrow
    5 - kp_5
    6 - kp_rightarrow
    7 - kp_home
    8 - kp_uparrow
    9 - kp_pgup
    0 - kp_ins
    + - kp_plus
    - - kp_minus
    / - kp_slash
    . - kp_del
    * - *
    Enter - kp_enter
    * Important Notes *
    This is just some stuff to think about if you're having problems or are wondering about anything.

    Don't use uppercase letters for the keys or else your scripts may not function properly.
    If your scripts don't seem to be working, first make sure that you've setup your autoexec properly, then check spelling, and then format. Most errors are caused by misspelling.
    If you don't have enough money to buy all the items, the game will buy in the order that you have the weapons/equipment listed in your script.
    If you just want to buy single clips of ammo use either buyammo1 for primary ammo, or buyammo2 for secondary ammo, very useful for if you just want to buy one or two magazines of AWP or Shotgun ammo.
    You can bind a key to use a certain weapon if you would like, which is very helpful with grenades, the following is an example: bind mouse4 "use weapon_hegrenade"
    You can also add text headers in your autoexec in order to keep different types of binds separated and labeled. Just add "//" to the beginning to make sure that the game doesn't try to read it as a command. The following is an example of what my autoexec looks like, so if you need more examples of buy script set up look here:
    //Walk Toggle Script
    alias walk "+speed; bind q run"
    alias run "-speed; bind q walk"
    bind q "walk"

    //Net_Graph Script
    alias +netgraph "net_graph 3"
    alias - netgraph "net_graph 0"
    bind alt "+netgraph"

    //Buy Scripts
    bind kp_home "buy p228; buy vest; buyammo2; buyammo2"
    bind kp_uparrow "buy m3; buy vest; buyammo1; buyammo1"
    bind kp_pgup "buy p90; buy vest; buy primammo"
    bind kp_leftarrow "buy galil; buy famas; buy vest; buy primammo"
    bind kp_5 "buy ak47; buy m4a1; buy vest; buy primammo"
    bind kp_rightarrow "buy sg552; buy aug; buy vest; buy primammo"
    bind kp_end "buy hegrenade; buy flashbang"
    bind kp_downarrow "buy primammo; buy secammo"
    bind kp_pgdn "buy vesthelm; buy vest"

    //Game Configs
    cl_showfps 1
    hud_drawhistory_time 1
    hud_deathnotice_time 3
    hud_saytext_time 5
    cl_smooth 0
    cl_ragdoll_collide 1
    bind mouse4 "use weapon_flashbang"
    bind mouse5 "use weapon_hegrenade"
  2. Dirty

    Dirty New Member

    Jul 9, 2003
    Likes Received:
    Trophy Points:

    thx dude, it rocks... it helps a lot
  3. CuRRyINaHuRRy

    CuRRyINaHuRRy New Member

    Jun 23, 2005
    Likes Received:
    Trophy Points:
    Just use auto scripts...no headache. :p
  4. Casualty

    Casualty New Member

    Nov 14, 2003
    Likes Received:
    Trophy Points:
    alot of headache becuase those scripts suck ;)

    and one thing to watch for deli and everyone esle is that the armor that he put in his script is not a vest and helmet, which makes a huge diff, i believe vesthelm is the one you want.

    scripts are definilty the way to go, good post deli
  5. mom

    mom New Member

    Jan 14, 2006
    Likes Received:
    Trophy Points:

    you can just download this. its a nifty lil tool i use. pretty pimp
    props to the creator. god knows i dont have the patience to learn code make something like this happen
  6. gbomb45

    gbomb45 New Member

    Aug 20, 2011
    Likes Received:
    Trophy Points:
    thanks for this
  7. Reid1

    Reid1 New Member

    Mar 18, 2012
    Likes Received:
    Trophy Points:
    Very helpful
  8. Perú Hardware

    Perú Hardware New Member

    Apr 19, 2020
    Likes Received:
    Trophy Points:
    Ohh very helpful hehehe. :love:

Share This Page