Counter-Strike: Source

What are CVARS?

What are CVARS? Heres your answer:

A CVAR is a ClientVARiable, what is a Client Variable you say? Ill answer that with a different question which is equivalent: What are options?

By now you should understand that a CVAR is ONE option that you have selected and configured personally. This means that for example, if you type in the console "crosshair_size 1200" your crosshair changes its size to "1200". A CVAR can also be a variable for a server, or even a variable that executes a command. For example:

"mp_timelimit" is a server CVAR ie a server variable. Setting this CVAR to "mp_timelimit 20" would make each map last 20 minutes.

"chooseteam" is an executing CVAR ie an "unvariable" because nomatter what you do with it it doesnt change by itself, "chooseteam 1" does not change the way "chooseteam" itself works. HOWEVER, it can be extended to "make" it a variable, example: "chooseteam;menuselect 2;menuselect 3" will change your team to CT and make you use the SAS model. If you now change that to "chooseteam;menuselect 1;menuselect 3" you will change team to T and use the Guerilla Warfare model. If you now, once again change it, into "chooseteam;menuselect 1" then it will end with a menu to choose which model you want for the Terrorist team. This works the same for the "buy" command as well as for many others.

Further Example:

When you press B (default) you will get a buymenu, depending which menu type you are using you will experience a different sort of menu, both have same CVAR funcitons however, because the two menus only LOOK differently. SO "buy" brings up the menu because of what b is bound to. b = buy "buy;menuselect 1;menuselect 1" buys you a glock because if you press B and then 1 twice you get a glock.

To wrap things up:

A CVAR is a VARIABLE which is usually CLIENT-SIDE. However if you are using RCON or any other admin-based mod (see What is RCON? tutorial) or if you're using the server, you can alter the SERVER options which will apply to everyone (these are however, options they usually can't control at all).

Share

Embed HTML:
Embed BB Code:
Embed Markdown:

More embeddable images

Bookmark and Share

Oh noes! You're not a Member!

Want access to cool stuff? As a member you can:

  • Post. Give the submitter your thoughts on this Tutorial.
  • Say Thanks. Show your appreciation by sending the submitter points.
  • Stamp Posts. Let other posters know what you think of their posts.
  • Rate. Give this Tutorial a rating out of 10.
  • Flag. Alert moderators and warn members of a problem with this Tutorial.
  • Vote. Vote the submitter for the Monthly Awards.
  • Subscribe. Get notified when this submitter submits again.

Interested? Register or Login

  • iShot avatar
    iShot Offline
    878 points Ranked 4303rd
    8 medals 3 rare
    • 1 post awarded Exemplary Feedback (bonus 1 point for posting) Medal
    • 5 posts awarded Exemplary Feedback (bonus 2 points for posting) Medal
    • One month a member (bonus 1 point on daily login) Medal
    • 6 months a member  (bonus 1 point on daily login) Medal
    • 1 year a member (bonus 1 point on daily login) Medal
    • 2 years a member (bonus 2 points on daily login) Medal
    • 4 years a member (bonus 4 points on daily login) Medal
    • 6 years a member (bonus 6 points on daily login) Medal
    Member Joined 8 years ago
    • Report icon

    So basicly making a REAL variable is only able to do with evenstripts and shit? To bad xD

    Revenge Scripter avatar
    User Title
    Revenge Scripter
  • throstur avatar
    throstur Offline
    1,739 points Ranked 2196th
    8 medals 4 rare
    • Reached 1,000 Points Medal
    • One month a member (bonus 1 point on daily login) Medal
    • 6 months a member  (bonus 1 point on daily login) Medal
    • 1 year a member (bonus 1 point on daily login) Medal
    • 2 years a member (bonus 2 points on daily login) Medal
    • 4 years a member (bonus 4 points on daily login) Medal
    • 6 years a member (bonus 6 points on daily login) Medal
    • 10 years a member (bonus 10 points on daily login) Medal
    Member Joined 12 years ago
    • Report icon
    Posted by iShot Do you know how to make your own cvars?

    The closest thing you can do without a server-side plugin is just to use aliases. Those are simple and simply work like so:

    alias "aliasname" "aliasfunction"

    an "aliasfunction" can be anything except the alias itself (or it will loop and crash).

    Completely Bananas! avatar
    User Title
    Completely Bananas!
  • iShot avatar
    iShot Offline
    878 points Ranked 4303rd
    8 medals 3 rare
    • 1 post awarded Exemplary Feedback (bonus 1 point for posting) Medal
    • 5 posts awarded Exemplary Feedback (bonus 2 points for posting) Medal
    • One month a member (bonus 1 point on daily login) Medal
    • 6 months a member  (bonus 1 point on daily login) Medal
    • 1 year a member (bonus 1 point on daily login) Medal
    • 2 years a member (bonus 2 points on daily login) Medal
    • 4 years a member (bonus 4 points on daily login) Medal
    • 6 years a member (bonus 6 points on daily login) Medal
    Member Joined 8 years ago
    • Report icon

    Do you know how to make your own cvars?

    Revenge Scripter avatar
    User Title
    Revenge Scripter
  • throstur avatar
    throstur Offline
    1,739 points Ranked 2196th
    8 medals 4 rare
    • Reached 1,000 Points Medal
    • One month a member (bonus 1 point on daily login) Medal
    • 6 months a member  (bonus 1 point on daily login) Medal
    • 1 year a member (bonus 1 point on daily login) Medal
    • 2 years a member (bonus 2 points on daily login) Medal
    • 4 years a member (bonus 4 points on daily login) Medal
    • 6 years a member (bonus 6 points on daily login) Medal
    • 10 years a member (bonus 10 points on daily login) Medal
    Member Joined 12 years ago
    • Report icon
    Posted by SomePlaceElse This isn't really much of a tutorial :/

    Jealous because I made it first? Trust me I've linked to this loads of times for people that are new to scripting.

    Completely Bananas! avatar
    User Title
    Completely Bananas!
  • xDamien avatar
    xDamien Offline
    5,428 points Ranked 686th
    8 medals 3 rare
    • Reached 1,000 Points Medal
    • Reached 2,500 Points Medal
    • One month a member (bonus 1 point on daily login) Medal
    • 6 months a member  (bonus 1 point on daily login) Medal
    • 1 year a member (bonus 1 point on daily login) Medal
    • 2 years a member (bonus 2 points on daily login) Medal
    • 4 years a member (bonus 4 points on daily login) Medal
    • 6 years a member (bonus 6 points on daily login) Medal
    Member Joined 9 years ago
    • Report icon

    This isn't really much of a tutorial :/

    Sidney Crosby is the boss avatar
    User Title
    Sidney Crosby is the boss
  • Cobalt avatar
    Cobalt Offline
    22,450 points Ranked 184th
    Member Joined 9 years ago
    • Report icon

    Good, although it could use some html formatting.

    Old School Bananite avatar
    User Title
    Old School Bananite

Credits

Authors
n/a
n/a

Submitter

throstur avatar
throstur Offline
1,739 points Ranked 2196th
8 medals 4 rare
  • Reached 1,000 Points Medal
  • One month a member (bonus 1 point on daily login) Medal
  • 6 months a member  (bonus 1 point on daily login) Medal
  • 1 year a member (bonus 1 point on daily login) Medal
  • 2 years a member (bonus 2 points on daily login) Medal
  • 4 years a member (bonus 4 points on daily login) Medal
  • 6 years a member (bonus 6 points on daily login) Medal
  • 10 years a member (bonus 10 points on daily login) Medal
Member Joined 12 years ago

throstur
Creator

Category

Rating

7.0/10

Details

Genre
Other/Misc
Difficulty Level
Intermediate

Stats

Post Count
6
ViewCount
9,790
Date Added
10 years ago
Date Modified
-