Jump to content
Sign in to follow this  
BEAKSBY

How to pass a variable into an EH?

Recommended Posts

Hi All,

How do I pass _gun1 into the "Killed" EH?

 _gun1 = createVehicle [_vehType, _pos,[], 0, "CAN_COLLIDE"]; 
_newUnit addeventhandler ["killed",{sleep 0.2;  
     _gun1 setVariable ["ReinforceStaticWeapon_addAction", TRUE, TRUE]; //HOW DO I PASS _gun1 into EH?
    _allowAddAction = _gun1 getVariable "ReinforceStaticWeapon_addAction";
    hint format ["fn_StaticWeaponDrop \n _newUnit ""killed"" EH \n _allowAddAction: %1", _allowAddAction]; 
}]; 

---------- Post added at 23:21 ---------- Previous post was at 22:51 ----------

NEVERMIND,

I used vehicle (_this select 0);

Share this post


Link to post
Share on other sites

You could also setvariable the _gun into the _newUnit and retrieve it using getvariable inside the killed EV.

Share this post


Link to post
Share on other sites
You could also setvariable the _gun into the _newUnit and retrieve it using getvariable inside the killed EV.

Yup, that works. Thanks again.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×