PDA

View Full Version : Problem with m_ commands


AlphaTrooper
23-01-2004, 10:54
I have a problem getting these commands to work with ClanMod or AMX Mod menus.

cm_cvar m_botmode "botswhenxplayers 4" "botvshuman" "humanvshuman" "botsfillserver" Xc

This is the code that I use for Clanmod to put it in the menu. The thing is, is that it won't let me switch these cvars. It will display the cvar, but none of the settings. Other non-mean cvars work perfectly.

How do I fix this?


Here are the rest of the Clanmod entries:

cm_cvar m_switchbotteam "any" "te" "ct" Xc
cm_cvar m_enforcebotteam "off" "on" Xc
cm_cvar m_botenhance "off" "on" Xc
cm_cvar m_botskill "lowest" "low" "medium" "high" "highest" "insane" "random" Xc
cm_cvar m_enforceclanteam "off" "on ct" "on te" Xc
cm_cvar m_warmode "all" "bots" "humans" "clan" "world" Xc
cm_cvar m_headshot "off" "all" "bots" "humans" "world" Xc

Here is an example of the the amxmod entries:

"m_switchbotteam" "any" "te" "ct" "u"

AlphaTrooper
26-01-2004, 06:47
anyone?

botmeister
26-01-2004, 06:53
The problem is that these are all registered server commands, not cvars. In the mEAn manual and "WhatsNew" doc for the WIP releases, all CVARs should be listed as "CVAR" in their descriptions. Anything that is a command will *not* have CVAR in its decsription.

AlphaTrooper
26-01-2004, 06:55
ok, so what's the difference between a server command and a cvar? do they register there settings differently?

botmeister
26-01-2004, 07:08
A command is a function call that gets executed when typed into the console, while a CVAR is like a data value that does nothing on its own, but can be read/changed by functions.

CVARs are mostly used to set configuration values, while commans are used to make things happen.

I suspect these menu systems will allow commands to be run from them.

tip: in place of "on" and "off" you can also use 1 and 0 respectively. Some menus will need this when doing a toggle switch between 0 and 1.

AlphaTrooper
26-01-2004, 07:13
yea, they do support this, it's not quite as nice as the cvars though. Just cause the cvars have multiple settings for each menu entry, where as the commands don't, oh well, not a huge deal, at least it's workable.