Main menu

Tutorial

Examples

 


Examples

Here are some ready script snippets for you to stick straight into your config files, with some helpful explanations.

Insult loop

This simply loops round some insults. If your model isn't doing anything else (ie running, jumping), it will also play the flip-off frames - perfect for when you're up against the boardie with a blaster...

set insult 1
bind DEL "insult$insult;wave 0"
alias insult1 "This is fun, isn't it...;set insult 2"
alias insult2 "I'm over here...;set insult 3"
alias insult3 "What's wrong, your mouseball missing?;set insult 4"
alias insult4 "Come on, next you'll be asking me to stand still...;set insult 5"
alias insult5 "Take your hand out of your pants and put it back on the keyboard...;set insult 1"

This can be easily modified for more sets of insults, such as a victory insult with wave 2.

Quit

This sets up F5 and F6 as a fast quit function.

alias quitfunc "bind f5 quitnow;bind f6 noquit;echo Press F5 to continue, F6 to cancel"
alias noquit "bind f5 quitfunc;bind f6 echo Press F5 to enable quit;echo Quit disabled"
alias quitnow "say Gotta go - bye...;quit"
noquit

Press F5 once, the quit is primed. Press F6, it goes back to normal, F5 and it quits having done the say command, letting people on the server know why you're going.

Rocket Jump

This is a rocket jump with a difference. Point at the floor and then hold the fire button. The longer you hold the button, the higher you will go.

alias waitn "wait;wait;wait;wait;wait;wait; wait;wait;wait;wait;wait; wait;wait;wait;wait;wait;wait;wait;wait"
alias bigwait "waitn;waitn;waitn;waitn;waitn;waitn"
alias +srj "+attack;+moveup;wait;wait;wait;cl_maxfps 0"
alias -srj "bigwait;cl_maxfps 190;-attack;-moveup"
bind m +srj

It freezes the player while they fire rockets. Then it unfreezes them, and if the player was facing the floor, they'll go flying. Watch out though - you are very vulnerable when you are frozen, especially considering you have probably almost halved your health and armour...

Zoom

Works a treat with an intellimouse.

alias 10z "fov 10; sensitivity 2; alias uz 100z; alias dz 20z; echo 10"
alias 20z "fov 20; sensitivity 2; alias uz 10z; alias dz 30z; echo 20"
alias 30z "fov 30; sensitivity 3; alias uz 20z; alias dz 40z; echo 30"
alias 40z "fov 40; sensitivity 3; alias uz 30z; alias dz 50z; echo 40"
alias 50z "fov 50; sensitivity 4; alias uz 40z; alias dz 60z; echo 50"
alias 60z "fov 60; sensitivity 4; alias uz 50z; alias dz 70z; echo 60"
alias 70z "fov 70; sensitivity 5; alias uz 60z; alias dz 80z; echo 70"
alias 80z "fov 80; sensitivity 6; alias uz 70z; alias dz 90z; echo 80"
alias 90z "fov 90; sensitivity 6; alias uz 80z; alias dz 100z; echo 90"
alias 100z "fov 100; sensitivity 6; alias uz 90z; alias dz 10z; echo 100"
100z
alias 100w w2
bind MOUSE3 "100$m3ev"
bind MWHEELUP "u$m3ev"
bind MWHEELDOWN "d$m3ev"

Simply cycles through a set of zooms, changing the mouse sensitivity accordingly. You could have a crosshair change in there too.

Score board

Simple. Opens and closes the score table.

alias +score "cmd help"
alias -score "cmd help"
bind F1 "+score"

Very useful for checking up on the scores halfway through a game - if someone drops in uninvited, you can far more easily take them out without having to aim through the score board...

Easy grenades

Grenades are brilliant, but awkward to use. This solves that problem.

alias +firegrenade "use grenades;+attack"
alias -firegrenade "-attack;weaplast"
bind MOUSE3 "+firegrenade"

When you hold down mouse 3, you switch to grenades and pull out the pin. When you let go, you lob the grenade and switch back to your previous weapon. Nice and simple, and very effective.
Just one problem - if you try to fire another grenade before weaplast is completed, weaplast gets confused, so you might like to set your own weaplast variable when you select a weapon.

Weapon switching

Fast and easy access to your favourite weapons.

alias w1 "echo Use Chaingun;use Chaingun;play weapons/chngnd1a;alias uw w2;alias dw w3"
alias w2 "echo Use Rocket Launcher;use Rocket Launcher;play weapons/rocklr1b;alias uw w3;alias dw w1"
alias w3 "echo Use Railgun;use Railgun;play player/gasp2;alias uw w1;alias dw w2"
bind / uw
bind . dw
w1

A simple loop. A sound is played when a different weapon is chosen to help you work out which weapon is currently selected.
Can be neatly integrated with the zoom function for an intellimouse - think along the lines of +mouse3 to change a variable...

Second weapon

You have two favourite weapons, right? One for up close, one for distance? Instead of having a weapon switching thang to toggle between them, simply have two fire buttons...

alias +closeattack "use blaster;use machinegun;use shotgun;use chaingun;use hyperblaster;use super shotgun;+attack"
alias -closeattack "-attack"
bind MOUSE1 "+closeattack"
alias +longattack "use blaster;use shotgun;use railgun;+attack"
alias -longattack "-attack"
bind MOUSE2 "+longattack"

When you press mouse 1 or mouse 2, the alias attempts to select the most appropriate weapon - the alias starts with the least appropriate first, so the most appropriate will be selected last. If the more appropriate weapons do not have any ammo, they will not be selected.
Here's an idea - have 11 fire keys for each of the different weapons...

Weapon and ammo dropping

This was mine a short while back. It's easiest if I give it to you in one large lump...

// Cycle Weapon Effect
alias cwe1 "alias cwe cweset;set cwev use;echo Ready to use weapon"
alias cweset "alias cwec cwe1;cwe2$dwav"
alias cwe2w "alias cwe cwe3;set cwev dw;echo Ready to drop weapon"
alias cwe2wa "alias cwe cwe3;set cwev dwa;echo Ready to drop weapon and ammo"
alias cwe3 "alias cwe cwe4;set cwev da;echo Ready to drop ammo"
alias cwe4 "alias cwe cwe5;set cwev a;echo Ready to ask for weapon"
alias cwe5 "alias cwe cwe2$dwav;set cwev aa;echo Ready to ask for ammo"
cwe1
bind SPACE "cwe"
bind KP_INS "cwe1"

alias dwas1 "set dwav w;alias dwas dwas2"
alias dwas2 "set dwav wa;alias dwas dwas1"
dwas1
bind = "dwas"

// Weapon Binds
bind 1 "weap1$cwev;cwe1"
bind 2 "weap2$cwev;cwe1"
bind 3 "weap3$cwev;cwe1"
bind 4 "weap4$cwev;cwe1"
bind 5 "weap5$cwev;cwe1"
bind 6 "weap6$cwev;cwe1"
bind 7 "weap7$cwev;cwe1"
bind 8 "weap8$cwev;cwe1"
bind 9 "weap9$cwev;cwe1"
bind 0 "weap0$cwev;cwe1"
bind - "weapg$cwev;cwe1"

// Weapon Uses
alias weap1use "use Blaster"
alias weap2use "use Shotgun"
alias weap3use "use Super Shotgun"
alias weap4use "use Machinegun"
alias weap5use "use Chaingun"
alias weap6use "use Grenade Launcher"
alias weap7use "use Rocket Launcher"
alias weap8use "use HyperBlaster"
alias weap9use "use Railgun"
alias weap0use "use BFG10K"
alias weapguse "use Grenades"

// Weapon Drops
alias weap1dw "say_team I've got spare weapons %l"
alias weap2dw "say_team Shotgun dropped %l ;drop shotgun"
alias weap3dw "say_team Super Shotgun dropped %l ;drop super shotgun"
alias weap4dw "say_team Machinegun dropped %l ;drop machinegun"
alias weap5dw "say_team Chaingun dropped %l ;drop chaingun"
alias weap6dw "say_team Grenade Launcher dropped %l;drop grenade launcher"
alias weap7dw "say_team Rocket Launcher dropped %l ;drop rocket launcher"
alias weap8dw "say_team HyperBlaster dropped %l ;drop hyperblaster"
alias weap9dw "say_team Railgun dropped %l ;drop railgun"
alias weap0dw "say_team BFG dropped %l ;drop bfg10k"
alias weapgdw "say_team Grenade ball dropped %l ;drop grenades"

// Weapon and ammo drops
alias weap1dwa "say_team I've got spare stuff %l"
alias weap2dwa "say_team Shotgun and ammo dropped %l ;drop shotgun ;drop shells"
alias weap3dwa "say_team Super Shotgun and ammo dropped %l ;drop super shotgun ;drop shells"
alias weap4dwa "say_team Machinegun and ammo dropped %l ;drop machinegun ;drop bullets"
alias weap5dwa "say_team Chaingun and ammo dropped %l ;drop chaingun ;drop bullets"
alias weap6dwa "say_team Grenade Launcher and ammo dropped %l;drop grenade launcher;drop grenades"
alias weap7dwa "say_team Rocket Launcher and ammo dropped %l ;drop rocket launcher ;drop rockets"
alias weap8dwa "say_team HyperBlaster and ammo dropped %l ;drop hyperblaster ;drop cells"
alias weap9dwa "say_team Railgun and ammo dropped %l ;drop railgun ;drop slugs"
alias weap0dwa "say_team BFG dropped and ammo %l ;drop bfg10k ;drop cells"
alias weapgdwa "say_team Grenade ball dropped %l ;drop grenades"

// Ammo Drops
alias weap1da "say_team I've got spare ammo %l"
alias weap2da "say_team Shells dropped %l ;drop shells"
alias weap3da "say_team Shells dropped %l ;drop shells"
alias weap4da "say_team Bullets dropped %l ;drop bullets"
alias weap5da "say_team Bullets dropped %l ;drop bullets"
alias weap6da "say_team Grenade ball dropped %l ;drop grenades"
alias weap7da "say_team Rocket rack dropped %l ;drop rockets"
alias weap8da "say_team Cells dropped %l ;drop cells"
alias weap9da "say_team Slugs dropped %l ;drop slugs"
alias weap0da "say_team Cells dropped %l ;drop cells"
alias weapgda "say_team Grenade ball dropped %l ;drop grenades"

// Weapon Requests
alias weap1a "say_team Weapon needed %l"
alias weap2a "say_team Shotgun needed %l"
alias weap3a "say_team Super Shotgun needed %l"
alias weap4a "say_team Machinegun needed %l"
alias weap5a "say_team Chaingun needed %l"
alias weap6a "say_team Grenade launcher needed %l"
alias weap7a "say_team Rocket launcher needed %l"
alias weap8a "say_team HyperBlaster needed %l"
alias weap9a "say_team Railgun needed %l"
alias weap0a "say_team BFG needed %l"
alias weapga "say_team Grenades needed %l"

// Ammo Requests
alias weap1aa "say_team Ammo needed %l"
alias weap2aa "say_team Shell pack needed %l"
alias weap3aa "say_team Shell pack needed %l"
alias weap4aa "say_team Bullet pack needed %l"
alias weap5aa "say_team Bullet pack needed %l"
alias weap6aa "say_team Grenade pack needed %l"
alias weap7aa "say_team Rocket pack needed %l"
alias weap8aa "say_team Cell pack needed %l"
alias weap9aa "say_team Slug pack needed %l"
alias weap0aa "say_team Cell pack needed %l"
alias weapgaa "say_team Grenade pack needed %l"

The beggining is kinda messy and difficult to understand, but this is how it works:
Space cycles through extra weapon effects - drop a weapon, drop ammo, ask for a weapon and ask for ammo.
= toggles the first weapon effect (drop a weapon) between dropping only a weapon and dropping ammo too.
0 on the keypad turns the weapon effect to use weapon. The weapon effect is automatically set to use a weapon when any weapon effect takes place (ie a weapon is selected).
What I have now is the same thing but set up so that holding down a key will temporarily change the number keys to drop a weapon, for example, and when let go of, the number keys will return to normal.




If you know of any script snippets which should be added to this, please contact me via the contact page.