simonwa1 0 Posted January 14, 2008 Hello! I need to add an eventhandler to a vehicle. But I have i variable that I must evaluate in addEventHandler argument. I'll show you. Syntax: (from Wiki) Quote[/b] ]Number = object addEventHandler ["type", {code}] I have a string-variable that needs to be evaluated and then put in as an argument to addEventHandler. Look.. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _myString = "Weeeii"; vehicle1 addEventHandler ["getIn", { [ _this select 0, _myStringEvaluated(<----)] }; So the arugument is parsed like this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ["getIn", [_this select 0, "Weeeii"]; Can someone help? Bye! Share this post Link to post Share on other sites
simonwa1 0 Posted January 14, 2008 Problem solved. Solution: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _str = "[_this select 0, '" + _myString + "'] execVM 'veh_lock.sqf'"; _vcl addEventHandler ['getIn', _str]; Notice that there is no curled barces {}; Share this post Link to post Share on other sites