Author Topic: IF, in binds.  (Read 2221 times)

DraZiLoX

  • Posts: 844
  • Turrets: +24/-24
IF, in binds.
« 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."

David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
Re: IF, in binds.
« Reply #1 on: October 31, 2009, 05:25:52 pm »
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.

DraZiLoX

  • Posts: 844
  • Turrets: +24/-24
Re: IF, in binds.
« Reply #2 on: October 31, 2009, 07:49:35 pm »
Okay...

Celestial_Rage

  • Posts: 636
  • Turrets: +120/-8
Re: IF, in binds.
« Reply #3 on: November 01, 2009, 02:00:23 am »
I also understand that there is also an /if command for comparing cvars?

I've tried it and the output I get is:
Code: [Select]
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

  • Spam Killer
  • *
  • Posts: 1376
  • Turrets: +66/-32
Re: IF, in binds.
« Reply #4 on: November 01, 2009, 02:44:00 am »
/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.
« Last Edit: November 01, 2009, 02:46:40 am by UniqPhoeniX »

Amanieu

  • Posts: 647
  • Turrets: +135/-83
    • Amanieu
Re: IF, in binds.
« Reply #5 on: November 01, 2009, 11:43:03 am »
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