Home   Help Search Login Register  

Author Topic: Event Handler Question  (Read 1185 times)

0 Members and 1 Guest are viewing this topic.

Offline RM Snipe

  • Members
  • *
  • RM kicks butt!
Event Handler Question
« on: 12 Aug 2004, 08:45:18 »
Hi All,

How would do I add these event handlers together in Init= of eventhandlers class..?


class EventHandlers: ECP_EventHandlers
         {
                                                   
      Init="[_this select 0, 1] exec ""\xxx_infantry\scripts\xxx_init.sqs""; if (format[{%1},count ECP_addUnitsArray] == {scalar}) then {ECP_addUnitsArray = []}; ECP_addUnitsArray = ECP_addUnitsArray + [_this select 0]; _this call ECP_EH_handler_init;";
         fired = "if ( (_this select 1 in [{Throw},{JAM_AT4Launcher},{JAM_RPG7Launcher},{JAM_M72LAWLauncher}]) or (_this select 4 in [{JAM_MarkerGrenadeammo}]) ) then {_this exec {\JAM_Magazines\FX\firedEH.sqs}}; _this call ECP_EH_handler_fired;"
                                                 

                                                  };
         
I want to add this code to above field "_this select 0 exec ""\xxx_infantry\scripts\unit_swimscript.sqs"";";

How would I do it ?
I have fiddled around but as not being a programmer,syntaxs etc well still learning if ever,lol.. :-[

Thanks RM Snipe.
« Last Edit: 14 Aug 2004, 08:16:16 by RM Snipe »

Offline RM Snipe

  • Members
  • *
  • RM kicks butt!
Re:Event Handler Question
« Reply #1 on: 15 Aug 2004, 14:15:15 »
ANYONE GOT AN ANSWER..??????? :'(

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Event Handler Question
« Reply #2 on: 15 Aug 2004, 14:47:14 »
Hmm...
You mean like this?:

class EventHandlers: ECP_EventHandlers
         {
                                                   
      Init="[_this select 0, 1] exec ""\xxx_infantry\scripts\xxx_init.sqs""; if (format[{%1},count ECP_addUnitsArray] == {scalar}) then {ECP_addUnitsArray = []}; ECP_addUnitsArray = ECP_addUnitsArray + [_this select 0]; _this call ECP_EH_handler_init; _this select 0 exec ""\xxx_infantry\scripts\unit_swimscript.sqs""";
         fired = "if ( (_this select 1 in [{Throw},{JAM_AT4Launcher},{JAM_RPG7Launcher},{JAM_M72LAWLauncher}]) or (_this select 4 in [{JAM_MarkerGrenadeammo}]) ) then {_this exec {\JAM_Magazines\FX\firedEH.sqs}}; _this call ECP_EH_handler_fired;"
                                                 

                                                  };

You may need to use [_this select 0] exec blah blah instead, depending on how the script is written...
« Last Edit: 15 Aug 2004, 14:48:09 by HateR_Kint »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline RM Snipe

  • Members
  • *
  • RM kicks butt!
Re:Event Handler Question
« Reply #3 on: 18 Aug 2004, 09:06:09 »
THANKS HateR_Kint, problem solved   :D.........