+/- Aliases

Hello, I am going to introduce you to + and - aliases. First of all, you will need to know what they are. If a + sign is placed infront of your alias, then everything said in that alias will happen when you press the button bound to that alias down. Another alias that has the same name, except with a - sign infront of it, will execute when you release the button bound to the original alias. Here is an example:


bind "SPACE" "+jump"

If we just look at the +jump bit, this means when you press the Space Bar, it will jump, but when you release the Space Bar, it will stop jumping. Here is how to create the alias.

Step #1

Choose something you want to use the alias for, the example we will use for this tutorial is to buy the MP5. First we need to create the aliases, and as I said above, we need to make a + alias and a - alias. So here we are:


alias +buymp5
alias -buymp5

Step #2

So whatever we put in the '+buymp5' alias, will execute upon keypress, and anything in the '-buymp5' will execute upon release. So, now we need to add the command to buy the MP5.


alias +buymp5 "buy; menuselect 3; menuselect 1"
alias -buymp5

Step #3

So, when we press the button assigned to this alias, it will buy the MP5, but will not do anything else. So, we need to give it something to do upon key release. For this example we will echo 'MP5 Weapon Bought!' to the screen. Remember to turn developer on and off, before and after the command. We do this by adding this into the alias;


developer 1; echo MP5 Weapon Bought!; developer 0

So the whole alias becomes:


alias +buymp5 "buy; menuselect 3; menuselect 1"
alias -buymp5 "developer 1; echo MP5 Weapon Bought!; developer 0"

Step #4

So there it is! All we need to do now is to setup a bind for this alias, we would do this by putting the following in your 'config.cfg':


bind "?" "+buymp5"

Remember, we don't need to bind a key to '-buymp5' as this will be executed when we release the key bound to +buymp5.

The Final Result

If you would like to use this code, just copy and paste this into the correct files, see the Introductory tutorial to find out which.


alias +buymp5 "buy; menuselect 3; menuselect 1"
alias -buymp5 "developer 1; echo MP5 Weapon Bought!; developer 0"

bind "?" "+buymp5"

I hope you enjoyed the tutorial!

Comments

x.liquid.x
23:40 4/1/2002
hmmmmm. i wunder if....
you could set the +/- aliases so that when you click mouse 1 it will shoot and when you release it it will also shoot !!!! this would be handy when using the glock twice the firing speed heheh just a thot if you cud do that your shud post it on your site!!!!:) [ Comment: Report | IP: Logged ]
MuDgE
14:27 5/1/2002
//Weapon Press/Release Fire Script
alias +weappr "+attack; wait; -attack; wait"
alias -weappr "+attack; wait; -attack"
bind "?" "+weappr"

That should fire your currently selected weapon upon keypress, and again when released.

Hope it helps... [ Comment: Report | IP: Logged ]
Dr.Vee
21:27 14/1/2002
Well, it doesn't seem to work as expected... Well, it does, but probably everyone will be able to fire faster only by clicking mb... [ Comment: Report | IP: Logged ]
J.R.M.
20:38 19/2/2002
If anyone is interested i just finished a rough version of my first bind script program. [ Comment: Report | IP: Logged ]
Xa3r0^
09:45 21/5/2002
I really want your buyscript program!!!

pagus_85@hotmail.com

or

148573202 on ICQ [ Comment: Report | IP: Logged ]
Xa3r0^
09:46 21/5/2002
Sorry bindscript program!

<a href="mailto:Pagus_85@hotmail.com">mailme! [ Comment: Report | IP: Logged ]
saiyan
00:17 7/7/2002
if you really got that bind program and if it works; then mail me : spyro_29@hotmail.com or icq : 155809244
please e-mail me i would have fun with it. see you later maybe [ Comment: Report | IP: Logged ]
pawxor
23:44 25/9/2002
Jus like to say, I read three guides on scripting and was having trub getting my head around it.

Read this (which aint even an intro to scripting) and it clicked straight away!

Thx dood! [ Comment: Report | IP: Logged ]
-[KAOS]-
20:02 16/1/2003
Hi, I just wanted to know if you would be able to have +mp5buy buy the mp5 and then -mp5buy buy primary ammo.

²°°³ =××x |3 0 |2 || - T0 - @ // P x××= ²°°³ [ Comment: Report | IP: Logged ]
IEatGreyFoxes
06:50 9/5/2003
Yes, you can do this. Try this script:

alias +buymp5 "buy; menuselect 3; menuselect 1"
alias -buymp5 "buy; menuselect 6"
bind "?" "+buymp5" [ Comment: Report | IP: Logged ]
JoHn_S
14:21 1/7/2003
You have all made a mistake on these script!
You leave the buymenu open.
Try this:

alias "ms1" "menuselect 1"
alias "ms3" "menuselect 3"
alias "ms6" "menuselect 6"
alias "d1" "developer 1"
alias "d0" "developer 0"

bind ? "+buymp5"
alias "+buymp5" "buy;ms3;ms1;buy;ms6"
alias "slot10;d1; echo mp5 bought !;d 0;slot10"

Or another that i find generally better:

alias "b-mp5" "buy;ms3;ms1;buy;ms6;wait;d1;echo mp5 bought !;d0t;wait;wait;slot10;wait;wait;slot10;slot10"
bind ? "b-mp5"
I personally use the last one :-) [ Comment: Report | IP: Logged ]
Add comment

Menu

News
Features
Events
Site
Search UKT:

User



Register here

Shoutbox

Zechs_
*sniff*
04:40 3/9/2008

X
JESUS CHRIST ITS A LION
23:33 27/8/2008

`NWA
lol @ this shoutbox going stron 2 years after the last news item was posted.
02:22 27/8/2008

w1ckedz
I wrote that Culexus comment Myers hahahaha
21:32 25/8/2008

tiz
Stealing is terrible I know! Some ****er even had the cheek to put it on ebay... [ [ expand ]