Author Topic: OnRealistic?  (Read 780 times)

0 Members and 1 Guest are viewing this topic.

Offline zyxstand

  • Veteran
  • *****
  • Posts: 1106
  • Mother of all Bombs
OnRealistic?
« on: July 01, 2007, 05:22:40 pm »
Is there anything that gets called when a game is turned into realistic via /realistic 1 ?  Or perhaps another way around?
I want to call a procedure when /realistic 0 or /realistic 1 is entered.  It doesn't matter if /realistic 1 is typed when it's already realistic.  The procedure checks for itself if it's on or off and writes the corresponding maximum health in a variable (150 if normal, 65 if real).  That's why it doesn't matter if realistic didn't actually change but the procedure is still called.
If there's a work-around that can call the procedure when there's a chance realistic is changed then that'd work too.
I tried to check for if /realistic 1 or /realistic 0 is typed as a command but that didn't do anything :/
Also, ActivateServer doesn't get called when you do /realistic 1 or 0.
...I don't want to have to check for it every second (which is an alternative).  Currently I have it so you have to type /real as admin and my procedure gets called.

For that matter, how do you do the same for /survival, /advance, and /gamemode ?
Can't think of anything original to put here...

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: OnRealistic?
« Reply #1 on: July 01, 2007, 07:05:19 pm »
The OnCommand should work for that. How did you tested it?
urraka

Offline zyxstand

  • Veteran
  • *****
  • Posts: 1106
  • Mother of all Bombs
Re: OnRealistic?
« Reply #2 on: July 01, 2007, 07:39:40 pm »
OMG wtf.  That was totally idiotic on my part.
The problem was that when the function was called, the game itself hasn't switched to realistic yet so it messed up.
Sorry :-\
(I feel rly stupid now lol)
Can't think of anything original to put here...