News:

Come Chat with us live! Learn how HERE!

Main Menu

IF, in binds.

Started by DraZiLoX, October 31, 2009, 04:16:50 PM

DraZiLoX

Is possible use IF in binds?

Like:

bind 1 "say !specme;if team spectate;echo Spectator cant join spectators."

David

Nope.
However that specific example can be achieved using team configs, so the bind gets changed depending on what team you are on.
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.


Celestial_Rage

I also understand that there is also an /if command for comparing cvars?

I've tried it and the output I get is:
if <value1> <operator> <value2> <cmdthen> (<cmdelse>) : compares the first two values and executes <cmdthen> if true, <cmdelse> if false

but, I have no clue how to use it. I've tried what it says, but it still doesn't work..
"The reports of my death are greatly exaggerated" ~Mark Twain

UniqPhoeniX

#4
/if is a tremfusion feature, along with many other nice scripting features. "if \$g_unlagged\ = 1 unlagged_on unlagged_off" will "vstr unlagged_on" if unlagged is enabled and "vstr unlagged_off" if not (ofc you have to create those). Tho "team" is not a variable, so can't be used in if cmd, but you can create a variable that is changed depending on your team.

Amanieu

A p_team variable will be available in the next release.
Quote
< kevlarman> zakk is getting his patches from shady frenchmen on irc
< kevlarman> this can't be a good sign :P