Jump to content

Recommended Posts

Posted

This is a Tutorial on Scripts:

 

Now lets begin, shall we.

 

///////////////////////////////////////////////////////////////////////////////////////

The Basics

///////////////////////////////////////////////////////////////////////////////////////

 

First, go to Start>Run and type C:\Program Files\Steam\steamapps\user_name\counter-strike\cstrike

(This way, you can have easy access going into this folder).

(As Seen in Screen Shot A)

 

Now, view your folder. You should see one .cfg file that you should be concerned with. It is called, config.cfg. You should not worry about this file though. This file is for settings in game. For example, +mouse1 = fire. This, meaning, one click from the mouse button enables the weapon at hand to fire.

(As Seen in Screen Shot B)

 

Now, to get things further underway, there are a few other things that you should know about.

 

1. You do not need to make a file called, valve.rc

 

and

 

2. You do not need to save you custom settings and/or configurations in a file called, autoexec.cfg. You could but it really is not necessary.

 

I have tested this personally so there is no need to do any of the two above.

 

The reason why these are is this: remember the config.cfg file? Well, at the very bottom of this file is the command, exec userconfig.cfg.

(As Seen in Screen Shot C)

 

That command tells the game to execute the configuration file. Unfortunately, we do not have a file called, userconfig.cfg, but we will - soon enough.

 

Oh, yeah. All of this scripting stuff must be done in notepad.exc, and save this file titled, userconfig.cfg.

(As Seen in Screen Shot D)

 

//////////////////////////////////////////////////////////////////////////////////////

Binding

//////////////////////////////////////////////////////////////////////////////////////

 

Now, ask yourself - what is binding?

 

Binding is how you associate a command to a key (This is laments terms). Everything that happens in the game are associated commands.

 

For example: pressing w (Default) makes you move forward. Well, this command is +forward.

 

Now, to bind a key. Well, binding is very simple. This is the structure on how the bind works:

 

bind "command"

 

Of course, you can bind a key to several commands instead of one like so:

 

bind "command; command 2"

 

Of course, when you do this, make sure you put a space after the semi-colon or else the second command would not read - but the first command will. Also, you must code the command correctly. Please keep these 2 things in mind.

 

//////////////////////////////////////////////////////////////////////////////////////

Alias

//////////////////////////////////////////////////////////////////////////////////////

 

An alias associates a bunch of commands, like a bind, but the difference is that you assign a name to it.

 

The alias structure is not very much different than the binding structure.

 

For example:

 

alias xxx "command1; command2"

 

xxx = AnyName

 

Then, you must bind this to a key. Be it any key you want to.

 

Example:

 

bind f1 "xxx"

 

xxx= the name that you have assigned to the alias.

 

//////////////////////////////////////////////////////////////////////////////////////

Saving the script

//////////////////////////////////////////////////////////////////////////////////////

You can save all of this in the file, userconfig.cfg. Go to Start>Run and paste this into your cstrike folder.

(As Seen in Screen Shot E)

 

//////////////////////////////////////////////////////////////////////////////////////

Screenshot's

//////////////////////////////////////////////////////////////////////////////////////

 

A 3366.jpg

B width=640 height=414http://image.hazardstrip.com/ss/tuts/3367.jpg[/img]

C width=640 height=414http://image.hazardstrip.com/ss/tuts/3368.jpg[/img]

D width=640 height=414http://image.hazardstrip.com/ss/tuts/3369.jpg[/img]

E width=640 height=414http://image.hazardstrip.com/ss/tuts/3370.jpg[/img]

 

 

///////////////////////////////////////////////////////////////////////////////////////

 

credits to : chrisbitm

Guest
This topic is now closed to further replies.


×
×
  • Create New...