OFPEC Forum
Addons & Mods Depot => OFP - Addons & Mods General => Topic started by: RM Snipe 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.
-
ANYONE GOT AN ANSWER..??????? :'(
-
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...
-
THANKS HateR_Kint, problem solved :D.........