Take the 2-minute tour ×
Arqade is a question and answer site for passionate videogamers on all platforms. It's 100% free, no registration required.

I'm an administrator on a couple TF2 servers, and I've installed a couple Sourcemod plugins (MeleeMode, ClassChooser, etc.). However, to get these to work the way I want, I have to set variables manually through the console like

sm_cvar sm_meleemode_enabled 1

While I know how to set up a local alias for a console command, I'd like to be able to create a server-wide "shortcut" so that all the admins will be able to use it without any setup on their end. I'd like them to be able to just open the console and type

meleeon

and this command would execute. Is there something I can add to the server.cfg or autoexec.cfg that will do this? Or maybe another workable solution?

share|improve this question

1 Answer 1

up vote 6 down vote accepted

The server alias syntax is the same as on the client side. You can place aliases inside server.cfg or choose to separate them into their own file for the sake of neatness.

server.cfg

exec aliases.cfg

aliases.cfg

alias "meleeon" "sm_cvar sm_meleemode_enabled 1;sm_cvar example 0"
alias "meleeoff" "sm_cvar sm_meleemode_enabled 0;sm_cvar example 1"

You should also be able to change the default values of cvars registered in SourceMod plugins or have them vary by map. Just ask if that interests you.

share|improve this answer
1  
Ahh - this was what I was missing. I tried putting that alias line right into server.cfg, but the aliases never registered. Thank you! –  Jeffrey Jul 19 '10 at 13:53
    
I just tried this last night, and I couldn't get it to work. meleeon and meleeoff were never registering as commands. I used sourcemod to reload server.cfg, and even tried map changes. –  Jeffrey Jul 22 '10 at 13:58
    
@Jeffrey: As I recall, sm_cvar is actually a chat command, so you may need to put say before it. –  user2974 Sep 1 '10 at 14:44
    
What about for something that is a single command? say sm_bmerasmus, i want it to just be bemeras, no changing of server cvars, just a command to do something ingame –  user48883 May 21 '13 at 0:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.