bobby budnick 0 Posted July 5, 2007 I have been trying to add an action to a unit after he respawns. Â I have tried 2 different ways to do this with no success. First way: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> this addeventhandler ["killed", {"this addaction (""Drop Chopper"", ""paradrop.sqs"")"}]; This is in the unit's init line. Â When he respawns the action is not added. Â There are no errors. Second way: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> this addeventhandler ["killed", {"_this exec (""addaction.sqs"")"}]; This is in the unit's init line. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _unit = _this select 0 _unit addAction ["Drop Chopper", "paradrop.sqs", _unit, 0, false, false, ""]; This is in the script. When he respawns the action is not added. Â There are no errors. Any ideas on this? Share this post Link to post Share on other sites
squeeze 22 Posted July 5, 2007 add a repeating trigger in the condition put (alive unitsname) in the activation put the addaction that works in the units init line. also remove the one from the units init line or you will have 2 actions at mission start. Share this post Link to post Share on other sites
bobby budnick 0 Posted July 5, 2007 Thanks for the help. My initial intent was to do it the cleaner way with eventhandlers and just add one line to each player and leave it at that. Apparently, it doesn't work that way. But, as this has been carrying on for too long, I just added triggers for everyone that I wanted to add an action for as you suggested. Share this post Link to post Share on other sites