Search
Username:
Password:

Register or Reset Password

SUBMISSIONS
Counter Strike
   New Maps
   New Tutorials
   New Skins
   New GUI's
   New Sounds
   New Threads
Other
   Media
   Gamers
   Clans
   Studios
How To Script #1
Difficulty: Beginner
Category: CS:S > ScriptingAuthor(s): Infallible

Hello and welcome to my series of How to Script tutorials. First I'll start off with explaining what a script is; a script is generally a console command or a bunch of console commands used to do something ingame.

For example
-A script could be used to restart the game 3 times before the start of a scrim/cal match.
-A script could be used to bind something to a key, for instance both mouse1 and the L key shoot.
-A script could be used to make an automatic weapon fire semi automatic, or burst fire.
-A script could be used to change settings with the press of a button, or toggle something on and off.

Now that you know what a script is, and what they do, lets show you how to make one! Our first project will be to create a script that will restart the game, wait, restart the game, wait, restart the game again, then say a message in the chat box. That's right, we're making a live on three script. Start off by opening a new text document, then renaming it to lo3.cfg. Yes, it's a cfg file, if your computer does not know how to open one (I'm not sure if they do by default) then right click on it and go to open with, then from there open it with notepad or some other text editing program that will open any file format.

Put these lines in:

alias "w1" "wait;"
alias "w5" "w1;w1;w1;w1;w1;"
alias "w10" "w5;w5;"
alias "w15" "w10;w5;"
alias "w20" "w10;w10;"
alias "w25" "w15;w10;"
alias "w50" "w20;w20;w10;"
alias "w100" "w50; w50;"
alias "w200" "w100; w100;"
alias "w400" "w200; w200;"
alias "w500" "w400; w100;"
alias "w750" "w400; w200; w100; w50;"
alias "w1000" "w500; w500;"


What do they do? Well, the alias command makes any word in the first set of brackets do the command that is in the second set of brackets. What i've done here is made w1 for 1 wait, w5 for 5 w1's, w10 for 2 w5's and so on, going all the way up to 1000 waits by simply typing the word w1000.

Now what does the wait command do? It makes a small pause between console commands that are in a script, or the console. Now because I have 1000 waits, that is a decent sized pause, but we will probably not have to use 1000 waits unless you have a very slow fps server. For accelerated servers we may even have to go down to 100 or 200 waits, but for most average servers 400-750 waits will be fine.

Now after those lines leave a few lines between and put this:

exec cssmatch.cfg

say (YOURNAMEHERE)'s lo3 script executed

w200

say ----====LIVE ON THREE====----


The exec command execs the cssmatch.cfg file which contains the rules for the match. We will make one of these later.

The say commands make a message appear in the chat box that appears to be typed by the console.

w200 is one of the alias commands we made earlier, which will cause the server to wait 200 times before doing the next step

After those lines put this:

w400

say ----====RESTART 1====----

mp_restartgame 1

w400

say ----====RESTART 2====----

mp_restartgame 1

w400

say ----====RESTART 3====----

mp_restartgame 1

w400


The w400s make the server wait 400 times before it does the next command.

You already know what say does.

mp_restartgame 1 will restart the round each time it is put there, but there must be enough waits inbetween or some will not register.

Next put this:

say ------------
w5
say E-----------
w5
say VE----------
w5
say IVE---------
w5
say LIVE--------
w5
say -LIVE-------
w5
say --LIVE------
w5
say ---LIVE-----
w5
say ----LIVE----
w5
say -----LIVE---
w5
say ------LIVE--
w5
say -------LIVE-
w5
say --------LIVE
w5
say E--------LIV
w5
say VE--------LI
w5
say IVE--------L
w5
say LIVE--------
w5
say -LIVE-------
w5
say --LIVE------
w5
say ---LIVE-----
w5
say ----LIVE----
w5
say -----LIVE---
w5
say ------LIVE--
w5
say -------LIVE-
w5
say --------LIVE
w5
say E--------LIV
w5
say VE--------LI
w5
say IVE--------L
w5
say LIVE--------
w5
say -LIVE-------
w5
say --LIVE------
w5
say ---LIVE-----
w5
say ----LIVE----
w5
say -----LIVE---
w5
say ------LIVE--
w5
say -------LIVE-
w5
say --------LIVE
w5
say E--------LIV
w5
say VE--------LI
w5
say IVE--------L
w5
say LIVE--------
w5
say -LIVE-------
w5
say --LIVE------
w5
say ---LIVE-----
w5
say ----LIVE----
w5
say -----LIVE---
w5
say ------LIVE--
w5
say -------LIVE-
w5
say --------LIVE
w5
say E--------LIV
w5
say VE--------LI
w5
say IVE--------L
w5
say LIVE--------
w5
say -LIVE-------
w5
say --LIVE------
w5
say ---LIVE-----
w5
say ----LIVE----
w5
say -----LIVE---
w5
say ------LIVE--
w5
say -------LIVE-
w5
say --------LIVE
w5
say ---------LIV
w5
say ----------LI
w5
say -----------L
w5
say ------------




It spams the server saying the match is live and the waits make each one delayed. This creates a fancy pattern of spamming live messages. Believe me, it's quite fun to watch. Next:

w100
say GL & HF
say Team (YOUR TEAMS NAME HERE)
w100

mp_startmoney 800



This concludes the script by saying GL & HF, good luck and have fun, and your teams name. If you do not have a team name you can put your name there instead of Team XXXXXX, or simply delete that line out of the script.

Well, now you know how to make an lo3 script. My next tutorial will show you how to make a config for this lo3.

~Infallible
Added: 6 months agoTags: how to script, infallible, btl studios, scripting
Feedback (5)
.
If you like a post, then thumb it!Y2M
Posted 6 months ago
Theres no point in editing waits at the top unless your gonna add them down below also. Anyway, the waits that are there work fine unless your server is boosted.
Buttons .
Bananite FTW?!Y2M
Posted 6 months ago
Sigh, the only place on the internet that mentions cssmatch.cfg, is here -_- SO, I'll have to ask my friend (Whom I hardly get to speak to) or ask here, or ask on the Programming/Console section of the forms. I'll prolly get a faster response on the fourms...

But, in the long run, nice LO3. I edited quite a bit, like how the restart text appears, the LIVE spam down at the bottom, and how many waits are at the top. 3127 waits is a decent number, right?
- Bananite FTW?!
.
If you like a post, then thumb it!Y2M
Posted 6 months ago
No? Maybe, but why can't I make my tutorials on it. If you think that this exact tutorial has you're mistaken, I made this myself.
:
Combat AmphibiansY2M
Posted 6 months ago
Hasn't this already been submitted?
.
If you like a post, then thumb it!Y2M
Posted 6 months ago
HTML in progress...
Add Feedback
Provide constructive feedback. What is "constructive"?
You cannot post yet!
Get involved on FPSB by posting your thoughts. Give authors your feedback to help them develop.

To post in this submission register or login.
Assessment
The community's verdict.
No assessments made... please vote!
You cannot assess yet!
Moderating FPSB is in your hands - when you assess a submission your vote determines its success or failure.

To vote on this submission register or login.
Stamps
This Tutorial in a nutshell...
No stamps recorded
You cannot stamp yet!
Stamps let you apply characteristics to submissions to help others understand them.

To stamp this submission register or login.

Brought to you by...
Evolution Studios
Never stop improving.
Membership: Invite Only
Primary Skills: 3D Animation, Coding/Scripting, Compiling, Mapping, Modelling, Texturing, UV Mapping, Server Administration
Inception: 18 days ago
Vote for Studio
Like this tut? Vote Evolution Studios for one or more monthly awards.
You must login or register to access this!
Related Tutorials