Author Topic: After Procedure Function?  (Read 1673 times)

0 Members and 1 Guest are viewing this topic.

Offline mikembm

  • Soldier
  • **
  • Posts: 210
After Procedure Function?
« on: March 29, 2007, 12:27:28 pm »
Is there anyway you can make a function that will execute after the procedure finishes?

For example, if you want to change someone back to alpha or bravo if they /setteam themselves to dela, then you have to use timers in apponidle if I'm not mistaken. Because all code in the procedures happen before the procedure happens. I just think this would make it much easier to do things.

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: After Procedure Function?
« Reply #1 on: March 30, 2007, 08:07:35 am »
regarding that special /setteam problem, you could just check the "text" parameter in OnCommand and if it contains /setteam3 or /setteam4, then it just forces them back... right? :O
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: After Procedure Function?
« Reply #2 on: March 30, 2007, 06:25:29 pm »
regarding that special /setteam problem, you could just check the "text" parameter in OnCommand and if it contains /setteam3 or /setteam4, then it just forces them back... right? :O

No, because what it does is the code is run before the actual event occurs. So in the /setteam situation it would set them to whatever team you chose but then run the actual procedure from the /setteam command.

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: After Procedure Function?
« Reply #3 on: March 31, 2007, 05:32:27 am »
then how about setting a boolean true in the OnCommand procedure and then in the OnJoinTeam procedure check the boolean, if true then /setteam him back to his previous team (teamnumber saved somewhere aswell)
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: After Procedure Function?
« Reply #4 on: March 31, 2007, 11:51:41 am »
then how about setting a boolean true in the OnCommand procedure and then in the OnJoinTeam procedure check the boolean, if true then /setteam him back to his previous team (teamnumber saved somewhere aswell)

That would work in next server (not in current one because onJoinTeam is not called for/setteam) however I think it would just make for some cleaner easier codes in this function was made.