quakergamer 0 Posted April 19, 2004 Hello, I execute on a soldier a script called SoldierInit.sqs. Here is what I doesnt work: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _soldier = _this select 0 ... #SoldierIsPlayer _soldier removeAllEventHandlers "init" _soldier addEventHandler ["fired",{"[_this select 0, _this select 1, _this select 2, _this select 3] exec ""\OPGWC_FX\ChupChup\WeaponJamRiffle.sqs"", [_this select 0, _this select 1] exec ""\OPGWC_FX\WeaponFX\backblast_detection.sqs"""}] _soldier addEventHandler ["hit",{"[_this select 0] exec ""\OFPEC_Blood\blood_squirt.sqs"""}] goto "Exit" ... There are NO errors in-game but the problem is that NONE of those scripts get executed when fired, hit ,etc... So I'm asking you guys if you know how to fix this! Share this post Link to post Share on other sites
hardrock 1 Posted April 19, 2004 You're mixing something up here: In all OFP scripts you can replace quotes (") with braces ({,}). If you write your execution part in braces, everything inside will be executed. So<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_soldier addEventHandler ["init", {"blabla..."}]will execute nothing than ... a string! Instead you have to write f.i.<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_soldier addEventHandler ["init", {[this,that] exec "myscript.sqs"}]What do we notice here? You can use single quotes, since you wrote the command in braces. You can also use quotes instead of the braces, but then all the quotes inside the command had to be double quotes like in the cpp, and that would be complicated Share this post Link to post Share on other sites