unknowncheats uc-forum.com ucdownloads ucdownloads.com

Go Back   UC-Tutorials - Multiplayer Game Hacking and Cheat Tutorials > First-Person Shooters > Counter Strike

- Sponsored Advertisement -
http://www.myfpscheats.com/


Reply
 
Thread Tools Display Modes
  #1  
Old 12-24-2006, 08:02 AM
zero_tolerance zero_tolerance is offline
Senior Member
 
Join Date: Dec 2006
Posts: 289
Default Basics of Scripting

By minesweeperxp

Basics of Scripting

What is a Bind ?

Bind is the Half-Life command that assigns a command to a key.
It can also assign an alias to a key.

Example:

bind x "+attack"

in this example the key "x" is made into the primary attack button


What is an Alias ?

An alias is a name YOU make for a command or a group of commands.
When you create an alias Half-Life treats it as if it was a normal command within the game.
You can now bind it to a key or use it in another alias.

Example:

alias biteme "say BITE ME YOU JACKASS!!!"

By typing this in the console(temporary) or putting this in a .cfg file
(recommended) you have just created the new HL command "biteme".
All that you have to do to use it is type "biteme" in the console or much
easier, bind it to a key:

bind d "biteme"

now every time you hit the letter "d" you would say to everyone on the
server "BITE ME YOU JACKASS!!!"

You can also put several commands into an alias to speed up things or
make things like buying in CS easier. The most common example is in
buy scripts. For example:

alias buymp5 "buy; menuselect 3; menuselect 1"
bind m "buymp5"

Now at the beginning of a round instead of puching the Buy key, then 3,
then 1 to buy an mp5, you would merely hit "m". Too easy

You can also use aliases inside of other aliases, again I use the weapons
buying example. Say you made aliases for all of the weapons and
equipment (as I have). A typical amount of money you have at the
beginning of a round is $2200. This buys you a kevlar vest, an mp5, and
primary weapon ammo.

Example of nested alias:

alias buymp5 "buy; menuselect 3; menuselect 1"
alias buyvest "buy; menuselect 8; menuselect 1"
alias ammo1 "buy; m6 "
alias buy2200 "buymp5; buyvest; ammo1"
bind n "buy2200"

Again, now at the beginning of a round you merely have to press "n" and
you have a vest, mp5, and ammo!!! ROCK!!!
Take note of one other thing, if you have more than one command you
are binding or aliasing, you must separate them by semicolons as above.


What is a Script ?

A script is a collection of binds and aliases which do more together than
they could by themselves. An example is a buying script, or a comms
script. There are many of these user made scripts available. Very shortly
I will have some posted for you to download. But if you read these
tutorials, you will be able to make your own if you want. Smile


the Console

The console is the screen which you can bring down while in a game.
It is a sort of command line within the game. By default it is brought down
by the tilde ( ~ ) key. This key is to the left of your number 1 key
on the top row of your keyboard.


the Files

The basic files needed to make your own binds, aliases, and scripts are:
config.cfg and autoexec.cfg.

CONFIG.CFG : Each mod of HL creates a config.cfg by default.
This is where the game stores all of your configurations and preferences;
keyboard and mouse controls, screen size, sound settings, renderer
settings, etc.
I recommend for several reasons that you DO NOT use this file to save
anything which you make which is custom. i.e. any of your aliases,
supercool binds, or commands to execute other files.
The simplest reason I will give is that when you reinstall, whatever mod
you are reinstalling will OVERWRITE YOUR CONFIG.CFG.
If you want to test this, simply make some changes in CS like what keys
you use to move and whatnot and then reinstall the latest patch.
Your config.cfg will be gone, replaced by the default. 'nuff said about that.
I do suggest if you haven't already
, that you open your config.cfg with a text editor and check it out.

AUTOEXEC.CFG : This file needs to be created by you.
This is the only other .cfg file which loads at startup of your game (unless
you are running a server). This important to know because if you have
other scripts or configuration files which need to be executed at startup,
they need to be referenced in this file. What? you don't see a file name
autoexec.cfg in your half-life\cstrike directory? As I said, YOU need to
make this file. This is simple.
Open any text editor like EditPad (my favorite), Notepad, Wordpad, Word,
Works, LotusNotes, whatever, make a new document, then from the File
Menu, choose Save As.
When the Save As dialogue box pops up, choose save as file type: All
Files, or Any File. This will give you a blank box hopefully.
Then in the file name box type the ENTIRE name: "autoexec.cfg".
Notice you include the .cfg . This is important. There you are done.
Also make sure you save it in the counterstrike directory (\cstrike\).
Later we will actually put some stuff in it.


Commands and Keys

It is important to know what commands are available for use as well as
what the names for some of the keys are when you are wondering why
you can't bind an alias to the Number Pad 4. Rather than try to cram it all
in here on the Beginner's Page,they both have their own pages.

Here are the commands: Commands Listing

Here are the keys: Bindable Keys Listing
Reply With Quote
Reply

  • Submit Thread to Digg
  • Submit Thread to del.icio.us
  • Submit Thread to StumbleUpon
  • Submit Thread to Google
  • Submit Thread to Facebook
  • Submit Thread to My Yahoo!
  • Submit Thread to MySpace
  • Submit Thread to Twitter
  • Submit Thread to Reddit

Tags
basics, scripting

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 06:19 AM.