- nav:
- cs-nation home
- counter-strike info
- scripting
- buy tutorial
buy tutorial
Introduction
Buy Scripts in Counter-Strike if used and set-up correctly can give you that
vital edge over your opponents. Image this scenario - the opposite team has
just won the previous round and have their guns, all they need is one
possible two clips and there off. You on the other hand have to buy a
weapon, ammo, vest, possibly grenades and a defuser. This takes a
considerable amount of time if you do it manually, but not if you have a
decent buy script. In this tutorial I will tell you how to make such a
script which buys weapons and equipment with a single push of a key. To
start off, each line of course needs to start off with the alias
command. After alias you put the name you want for your alias.
Once you have that done, you have to tell wether you want to buy weapons
and ammo or just equipment like kevlar. If you want to buy guns then you
will use the buy command, after that you will need to select which
sub-menu you wish to access, and then which item from that submenu you wish
to buy. If you want to buy equipment, you will use the buyequip
command and then after that you will need to select which item you with to
buy. Selecting which menu you want to access is done by the
menuselect command. First up, I'll list all the current menus as of
Counter-Strike Beta 7.1. On the left is what is displayed, when that menu is
accessed and on the right is the command needed to select that menu.
Main Buy Menu (buy)
This is a listing of all the buy menu options, when the buy command
is accessed. On the left is what is displayed, when that menu is accessed
and on the right is the command needed to select that menu.
Pistols
Shotguns Sub-Machine Gun Rifles Machine Guns Primary Ammo Secondary Ammo Equipment Menu |
menuselect 1
menuselect 2 menuselect 3 menuselect 4 menuselect 5 menuselect 6 menuselect 7 menuselect 8 |
Pistols (buy; menuselect 1)
This is a listing of all the buy menu options, when the buy; menuselect
1 command is accessed. On the left is what is displayed, when that menu
is accessed and on the right is the command needed to select that menu.
H&K USP .45 Tactical
Glock18 Select Fire Desert Eagle .50AE SIG P228 Dual Beretta 96G Elite FN Five-Seven |
menuselect 1
menuselect 2 menuselect 3 menuselect 4 menuselect 5 menuselect 6 |
Shotguns (buy; menuselect 2)
This is a listing of all the buy menu options, when the buy; menuselect
2 command is accessed. On the left is what is displayed, when that menu
is accessed and on the right is the command needed to select that
menu.
Benelli M3 Super90
Benelli XM1014 |
menuselect 1
menuselect 2 |
Sub-Machine Guns (buy; menuselect 3)
This is a listing of all the buy menu options, when the buy; menuselect
3 command is accessed. On the left is what is displayed, when that menu
is accessed and on the right is the command needed to select that
menu.
H&K MP5-Navy
Steyr Tactical Machine Pistol FN P90 Ingram MAC-10 H&K UMP45 |
menuselect 1
menuselect 2 menuselect 3 menuselect 4 menuselect 5 |
Rifles (buy; menuselect 4)
This is a listing of all the buy menu options, when the buy; menuselect
4 command is accessed. On the left is what is displayed, when that menu
is accessed and on the right is the command needed to select that menu.
AK-47
Sig SG-552 Commando Colt M4A1 Carbine Steyr Aug Steyr Scout AI Arctic Warfare/Magnum H&K G3/SG-1 Sniper Rifle Sig SG-550 Sniper |
menuselect 1
menuselect 2 menuselect 3 menuselect 4 menuselect 5 menuselect 6 menuselect 7 menuselect 8 |
Machine Guns (buy; menuselect 5)
This is a listing of all the buy menu options, when the buy; menuselect
5 command is accessed. On the left is what is displayed, when that menu
is accessed and on the right is the command needed to select that menu.
FN M249 Para
|
menuselect 1
|
Primary Ammo (buy; menuselect 6 or
buyammo1)
When the buy; menuselect 6 command is accessed, it will buy full ammo
for your primary weapon.
Secondary Ammo (buy; menuselect 7 or
buyammo2)
When the buy; menuselect 7 command is accessed, it will buy full ammo
for your secondary weapon.
Equipment Menu (buy; menuselect 8 or
buyequip)
This is a listing of all the buy menu options, when the buy; menuselect
9 or buyequip commands are accessed. On the left is what is
displayed, when that menu is accessed and on the right is the command needed
to select that menu.
Kevlar Vest
Kevlar Vest & Helmet Flashbang HE Grenade Smoke Grenade Defuse Kit NightVision Goggles |
menuselect 1
menuselect 2 menuselect 3 menuselect 4 menuselect 5 menuselect 6 menuselect 7 |
Writing your first buy alias
In your alias, each command must be seperated by a semi-colin
(;) and a space. To start your alias off, the first thing is
to have alias at beginning the of the line. Then after that you
choose your name of the alias, so if you were making one to buy a
MP5, you would probobly name it buymp5. Now you need to put it
together, alias first, name second, commands third. Here is an
example of an alias that will buy a mp5, but will not buy any
ammo:
alias buymp5 "buy; menuselect 3; menuselect 1"
A gun is pretty useless without ammo, so lets add appropiate command to buy
some ammo. In this case we are buying a MP5 which is a SMG, thus it is a
primary gun. So we would use the buyammo1 command. If you are buying
a pistol, you would use the buyammo2 command.
alias buymp5 "buy; menuselect 3; menuselect 1;
buyammo1"
If you were to go into a game right now and use that alias, you would
notice one thing, that the buy menu doesnt close. Never fear, their is a
command called slot10 that closes the menu. So, I guess your thinking
that you just need to add a slot10 to the alias. Well
unfortunatly it isnt that simple. Being the way the internet is, commands and data that is sent between you and the game server are often lost, so 9 times out of 10 a single slot10 isnt enough to close a menu. The only reliable way at the moment to close the menu is to put lots of slot10 commands seperated between wait commands. First up, heres the alias that I personally use to close my menus:
alias clrmenu "wait; wait; wait; slot10; wait; wait;
wait; wait; wait; wait; slot10; slot10; slot10; slot10"
Ok, now we need to modify the buy gun alias:
alias buymp5 "buy; menuselect 3; menuselect 1; buyammo1;
clrmenu"
Thats it! Now all you gotta do is bind buymp5 to a key. First
up, I'll show you how to close the menu, via your jump key. If the buy menus
stay up, after buying you may need to add a few more slot10 commands
to the clrmenu alias or find a server that doesnt lag as much.
bind KEY buymp5
- d0nk3y