aj_addons 0 Posted June 23, 2003 could somebody please tell me how to set up an event handler which will activiate my smoke script when my smoke luncher on my tank is fired i no it can be done becuse that pirana addon the swis mod made does it the weapons name in the config is smoke_luancher and the script is just called smoke but i have absoultly no idea how to set it up so could some kind person please help me its driving me insane Share this post Link to post Share on other sites
maddogx 13 Posted June 23, 2003 Here ya go: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> class Eventhandlers { fired = "[_this] exec ""\PBONAME\smoke.sqs"""; }; that goes in the config.cpp . Remember to replace PBONAME with the name of the PBO file your addon uses. Share this post Link to post Share on other sites
aj_addons 0 Posted June 23, 2003 where does it go does it go at the end of the config file or in the wepons deffinitions section? cause ive got one for a tank killed  flame script and thats at the end of the config its just with what youve shown me itn dosent seem to link it to the weapon being fired or am i just dumb? Share this post Link to post Share on other sites
BraTTy 0 Posted June 23, 2003 Like Maddog was stating ...add the eventhandlers class within your cfgvehicles for your tank. I would do something like this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> class EventHandlers { fired="[_this select 0,_this select 4] exec ""\youraddondir\smoke.sqs"""; }; And in your smoke.sqs ...something like this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ;smoke.sqs file _tank = _this select 0 _weapon = _this select 1 ? _weapon == "smoke_luancher" : goto "smoke" exit #smoke (insert smoke launcher routines here) You don't have to do anything to your cfgweapons or cfgammo for this to work.The "fired" eventhandler will run every time for each burst of any weapon (from my observations) Just make sure your smoke routines is linked with the proper weapon name in smoke.sqs Share this post Link to post Share on other sites
aj_addons 0 Posted June 24, 2003 thanks very much that will help alot Share this post Link to post Share on other sites