Pierrot 0 Posted February 16, 2003 Hi all, When I read readme.txt in patch 1.90, I found "Init" event handler. "Init" No arguments It seems that it receives no argument. Do you know what "Init" is and how you can use this event handler. Share this post Link to post Share on other sites
bn880 5 Posted February 16, 2003 I don't know so much about addons, but I assume you install it like any other handler in your addon (ie: hit), it will be run during the initisalization of the unit. (whenever it's created) Share this post Link to post Share on other sites
AXE 0 Posted February 16, 2003 Add this to your cpp file in the cfgvehicles section: class EventHandlers { Init = "(this select 0) do whatever"; } Whatever is in the init eventhandler will be executed when the unit is loaded. What they meant by 'no arguments' is that it returns only one variable, which is the unit using the eventhandler. Eventhandlers with multiple arguments have many returned variables - for example "fired" handler has: this select 0 = unit firing this select 1 = unit's weapon being fired this select 2 = muzzle of the weapon being fired this select 3 = fire mode of fired weapon (like burst/full auto) this select 4 = the ammo being fired from the weapon and the init eventhandler has: this select 0 = unit using the init handler Share this post Link to post Share on other sites
Pierrot 0 Posted February 17, 2003 I see. It will be loaded when the vehicle is created. Thanks all. Share this post Link to post Share on other sites
Guest BratZ Posted February 17, 2003 Ya it runs at mission startup,but realize that it doesn't run on all computers in a mp game. Good for checking startup routines or such (I use to fix my start flying gear down problem) Share this post Link to post Share on other sites