thestuntman 10 Posted June 27, 2013 say for example i have a script which is passed parameters in the usual way "nul = [[arty1,arty2,arty3],3,20,3,1] execVM "arty_smoke_test.sqf";" and these are grabbed in the script using _myBattery = _this select 0; _delay = _this select 1; _spread = _this select 2; _loop = _this select 3; ...... Is it possible to then reference these values with _idx = player addEventHandler ["Fired", {.... further in the same script? From what I have tried the event handler knows nothing about these values. Am I going about this the wrong way or is there a way to have these values passed to the event handler without making them globals? What i am trying to do is get the position of a smoke grenade, then call in a mortar strike on that position. I am able to do it just fine using ((position player) nearObjects["SmokeShell",150]), but the only problem is that it will pick up anyone's smoke grenade within whatever radius I have set. The reason i wanted to use event handlers is that it will confine the strike to just the player's grenades, and make it easy to remove the event handler whenever i don't want the ability to be available. Share this post Link to post Share on other sites
samatra 85 Posted June 27, 2013 I assume you have event handler in arty_smoke_test.sqf script? _myBattery = _this select 0; _delay = _this select 1; _spread = _this select 2; _loop = _this select 3; // ...... artyargs = _this; _idx = player addEventHandler ["Fired", { _myBattery = artyargs select 0; _delay = artyargs select 1; _spread = artyargs select 2; _loop = artyargs select 3; //........ }]; Share this post Link to post Share on other sites
thestuntman 10 Posted June 27, 2013 Yep I do, will give that a shot. Thanks for the quick reply Share this post Link to post Share on other sites