Tremulous Forum
General => Troubleshooting => Topic started by: DraZiLoX on October 31, 2009, 05:16:50 pm
-
Is possible use IF in binds?
Like:
bind 1 "say !specme;if team spectate;echo Spectator cant join spectators."
-
Nope.
However that specific example can be achieved using team configs, so the bind gets changed depending on what team you are on.
-
Okay...
-
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..
-
/if is a tremfusion feature, along with many other nice scripting features (http://www.tremfusion.net/wiki/Features_list). "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.
-
A p_team variable will be available in the next release.