InfuzionGaming.com
May 24, 2012, 02:25:41 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

Shout Box

[History] [Commands]

[April 08, 2012, 11:40:11 AM] Unpayed_overtime: *Sneezes*

[April 12, 2012, 04:04:25 PM] Lockem Shoto: Holy crap - the most retarded sh it happened

[April 12, 2012, 04:04:34 PM] Lockem Shoto: I was on a CSS server and apparently they LOVE communism

[April 12, 2012, 04:04:37 PM] Lockem Shoto: They gave admin to everybody

[April 12, 2012, 04:04:41 PM] Lockem Shoto: Nobody abuses for some reason

[April 12, 2012, 04:04:44 PM] Lockem Shoto: I"m surprised about that

[April 12, 2012, 04:05:02 PM] Lockem Shoto: I wanted if it'll collapse

[April 12, 2012, 04:05:09 PM] Lockem Shoto: Or if the admins were just bots playing with ping

[April 15, 2012, 08:46:22 AM] Hazmat: Sup kiddies

[April 26, 2012, 08:47:02 PM] Unpayed_overtime: Back on Xfire. Now If you want to play Minecraft, Make sure you have a legit one and Xfire me.

[May 11, 2012, 10:52:17 PM] lyfe: sup

[May 12, 2012, 11:17:12 AM] Unpayed_overtime: WARNING: May contain Ecchi content.

News:
Gameservers Offline, mostly playing League. Join Vent for chat/anything else!

 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Peter's Counter-Strike binding and scripting Tutorial.  (Read 921 times)
Peter^_^
Global Moderator
VIP User
*****

Popularity: 0
Offline Offline

Posts: 1916


View Profile
« on: February 28, 2009, 07:35:32 AM »

 In this tutorial i will teach you about binds and scripting CS 1.6

Binding commands to keys

The first building block of CS scripting - the bind command, used to assign actions to keys or mouse buttons. The syntax is:
bind <key> <command or alias>.

Example:
Code:
bind shift "walk"

This command in the console ( open console with "~" ) will make it so that the command Walk is assigned to your shift key.

Example2:
Code:
Bind F "weapon_knife"

This command creates a quick draw key to the F key so you just have to press F to access your knife.

Example3:
Code:
bind "KP_END" "m4a1; ak47"

This speeds up the buying process to ensure that you just have to press one button for a m4 or ak, whichever one is available
for your team.

Creating an alias


An "alias" is simply a name you choose for a command or set of commands. You assign commands to an alias with the syntax alias <alias_name> <command1; command2...>. An alias with a + sign in front is run when the key is pressed down, whereas a - sign means it's run when the key is released.

Example:
Code:
alias setname "name Peter#iDkB"
bind g setname

This will execute "name Peter#iDkB" when you hit g.

This really only becomes useful when you start stringing together commands.

Code:
alias waitlong "wait; wait; wait; wait; wait; wait; wait; wait"
alias +throwHE "weapon_hegrenade; waitlong; +attack"
alias -throwHE "-attack"
bind "1" "+throwHE"

Buy joining together all the needed commands, this script carries out all the steps needed to select and throw an HE grenade, on one key press.

Below is a slightly more complicated script to illustrate the idea - you can automate the whole bomb-planting sequence, and immediately have a gun ready as soon as you let go of the key (handy if you get caught by a CT while planting):

Code:
alias waitlong "wait; wait; wait; wait; wait; wait; wait; wait"
alias qwpn "weapon_galil; weapon_ak47; weapon_scout; weapon_sg552; weapon_awp; weapon_g3sg1;
 weapon_famas; weapon_m4a1; weapon_aug; weapon_sg550; weapon_m3; weapon_xm1014;
 weapon_mac10; weapon_tmp; weapon_mp5navy; weapon_ump45; weapon_p90; weapon_m249"
alias +plantbomb "weapon_c4; wait; +duck; waitlong; +attack"
alias -plantbomb "-duck; -attack; qwpn"
bind z +plantbomb

Line one strings together a few "wait" commands to make a longer pause (you may need to experiment with different lengths to get this working for you). Line 2 declares a crude-but-reliable quick weapon switch alias. Lines 4 and 5 declare the commands to run when the key is pressed down and released - in this case, the +attack and -attack commands simulate pressing and releasing the mouse button to plant the bomb.

Script Location

For Counter-strike 1.6, scripts must be saved in the root cstrike directory, with the extension .cfg - eg: C:\Steam\SteamApps\user_name\counter-strike\cstrike.

There should be at least two config files there already, config.cfg and userconfig.cfg.

Don't use config.cfg for your own scripts, it is likely to be overwritten by the game if you change your settings in the options menu.

Userconfig.cfg is the preferred location for user scripts - it is never automatically modified, and should be executed at every map change (if it isn't, check config.cfg contains the line "exec userconfig.cfg"

You will likely want to put some smaller scripts in their own files, which you can give any name so long as they have the .cfg extension. This is especially useful for creating binds that include spaces and double quotes, which would fail if you simply aliased them.



More Example Commands



Buy commands:

Pistols:
buy glock (9x19mm Sidearm)
buy usp (KM .45 Tactical)
buy p228 (228 Compact)
buy deagle (Night Hawk .50C)
buy elite (.40 Dual Elites) buy fiveseven (ES Five-Seven)

Shotguns:
buy m3 (Leone 12 Gauge Super)
buy xm1014 (Leone YG1265 Auto Shotgun)

SMG's:
buy mac10 (Ingram MAC-10)
buy tmp (Schmidt Machine Pistol)
buy mp5navy (KM Sub-Machine Gun)
buy ump45 (KM UMP45)
buy p90 (ES C90)

Rifles:
buy galil (IDF Defender)
buy ak47 (CV-47)
buy sg550 (Krieg 550 Commando)
buy famas (Clarion 5.56)
buy m4a1 (Maverick M4A1 Carbine)
buy aug (Bullpup)
buy scout (Schmidt Scout)
buy sg552 (Krieg 552)
buy awp (Magnum Sniper Rifle)
buy g3sg1 (D3/AU1)

Machine Guns:
buy m249 (M249)

Equipment:
buy primammo (Primary Ammo)
buy secammo (Secondary Ammo)
buy vest (Kevlar)
buy vesthelm (Kevlar+Helmet)
buy flashbang (Flashbang)
buy hegrenade (HE Grenade)
buy smokegrenade (Smoke Grenade)
buy nvgs (Nightvision)
buy defuser (Defusal Kit)

Binding to the Keypad:

These keys are not used in the default key binds, and (assuming you use WSAD for movement) are free to be bound to other commands. They are all located on the numpad, to the right hand side of a standard keyboard.

KP_INS (the 0 key)
KP_DEL (the decimal point)
KP_ENTER (the Enter key)
KP_PLUS (the Plus key)
KP_END (the 1 key)
KP_DOWNARROW (the 2 key)
KP_PGDN (the 3 key)
KP_LEFTARROW (the 4 key)
KP_5 (the 5 key)
KP_RIGHTARROW (the 6 key)
KP_HOME (the 7 key)
KP_UPARROW (the 8 key)
KP_PGUP (the 9 key)
KP_SLASH (the / key on the numpad)
* (the * key on the numpad)
KP_MINUS (the - key on the numpad)

Logged

Adboy
100+ user!
**

Popularity: -43
Offline Offline

Posts: 158


View Profile
« Reply #1 on: February 28, 2009, 07:59:03 AM »

No point, Illegal in leagues to have any binds of any sort
Logged
Peter^_^
Global Moderator
VIP User
*****

Popularity: 0
Offline Offline

Posts: 1916


View Profile
« Reply #2 on: February 28, 2009, 08:31:18 AM »

No it's not. I have all my buy binds on my keypad.


Plus not everyone here is going to be in a league.
Logged

lyfe
300+ Dedicated Member
****

Popularity: -80
Offline Offline

Posts: 348


View Profile Email
« Reply #3 on: February 28, 2009, 11:40:49 AM »

Peter stop beign so sure no ones gonna be in a league. Evry1 can. Btw adboy if u think it this way evrythin is a bind. How u move forward, sidewards are binded by some keys. Scripting the shots the way u shoot ur bullets binding the movements to make it easier wen u can do it easier. Thats illegal. Too much for Mr cevo-m.
Logged
Peter^_^
Global Moderator
VIP User
*****

Popularity: 0
Offline Offline

Posts: 1916


View Profile
« Reply #4 on: February 28, 2009, 12:18:50 PM »

I didn't mean that people here didn't have the ability to go leagues , I was saying that not everyone WANTS to go k?
Logged

lyfe
300+ Dedicated Member
****

Popularity: -80
Offline Offline

Posts: 348


View Profile Email
« Reply #5 on: February 28, 2009, 12:44:15 PM »

na huh. U said not everyone will be in a league.
Logged
sookee
Jr. Member
*

Popularity: -46
Offline Offline

Posts: 83


View Profile
« Reply #6 on: February 28, 2009, 02:19:52 PM »

Haters gtfo. This is a pub server and using binds and scripts is okay.

lyfe learn to fucking read.

"not everyone here is going to be in a league." means that there are people who will eventually play in leagues and there are also be people who will not.

HOW CAN YOU FUCKING FLAME WHEN U CANT UNDERSTAND WHAT OTHER PEOPLE ARE WRITING. HOLY SHIT YOU'RE RETARDED.
Logged
Peter^_^
Global Moderator
VIP User
*****

Popularity: 0
Offline Offline

Posts: 1916


View Profile
« Reply #7 on: February 28, 2009, 03:28:20 PM »

I know what I meant lyfe.

Stop Going offtopic.
Logged

lyfe
300+ Dedicated Member
****

Popularity: -80
Offline Offline

Posts: 348


View Profile Email
« Reply #8 on: February 28, 2009, 05:38:34 PM »

@ sookee. Read what he said kiddo. He said not evry1 is gping to be in a league. There are 2 meanings. So appaently u suck to comprehend and understand a simple snetence. Ur Srsly  retrded lol.


@ peter: I told u what i meant to.

This was offtopic and sorry.

Logged
Peter^_^
Global Moderator
VIP User
*****

Popularity: 0
Offline Offline

Posts: 1916


View Profile
« Reply #9 on: March 01, 2009, 07:34:26 AM »

Topic Closed due to Abuse.
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.12 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!