wld427 1705 Posted December 3, 2008 Fellas, im not a mster scripter and this one may seem trivial to yall but... on our mirage2000 we use a script for the niclear weapon and i am using the below eventhandler to fire that script <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">fired = "_this exec ""\PRACS_Mirage2000\weapons\Nuke.sqs"";"; how do i make it to check the weapon is "PRACS_M2k_B61_Launcher" cause now everytime i fire the machine gun the nuke goes off over and over LOL Share this post Link to post Share on other sites
Aqu 0 Posted December 3, 2008 The fired event handler gives an array to your script as a param. It has [unit, weapon, muzzle, mode, ammo] All other are strings except the unit is an object. Test that the ammo class matches the nuke. Share this post Link to post Share on other sites
wld427 1705 Posted December 3, 2008 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">fired = "if (_weapon=="PRACS_M2k_B61_Launcher") then {_this exec ""\PRACS_Mirage2000\weapons\Nuke.sqs""};"; something liek this is what im after but i get a bunch of errors Share this post Link to post Share on other sites
Aqu 0 Posted December 3, 2008 In the script which is launched in the fired event handler (Nuke.sqs), you have to check it e.g like this... <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _weapon = _this select 1; ?( _weapon == "PRACS_M2k_B61_Launcher" ): boom; EDIT: Â I suppose you can test it in the config line too, like you tryed, but then probably need to put it like: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> fired = "if(_this select 1 == ""PRACS_M2k_B61_Launcher"") then { _this exec ""...""}; "; Share this post Link to post Share on other sites
wld427 1705 Posted December 3, 2008 In the script which is launched in the fired event handler (Nuke.sqs), you have to check it e.g like this...<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _weapon = _this select 1; ?( _weapon == "PRACS_M2k_B61_Launcher" ): boom; EDIT: Â I suppose you can test it in the config line too, like you tryed, but then probably need to put it like: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> fired = "if(_this select 1 == ""PRACS_M2k_B61_Launcher"") then { _this exec ""...""}; "; i tries your idea int eh SQS..... causes a massive amount of Lag in game whent he machine gun is fired...... thats why i figured the init line would run better Share this post Link to post Share on other sites
[aps]gnat 28 Posted December 5, 2008 Check my released addons For 1 you need to go sqf, not sqs Note that the VERY FIRST check is "if not Gun" This will help reduce lag. Quote[/b] ]_array = _this select 0;_weapon = _array select 1; _ammoname = _array select 4; _plane = _array select 0; \\ If it's just the gun, then get out if(_weapon != "GSh301") then { \\ if its not the gun then it must be one of these if(_ammoname == "RKT_R27_AA") then { //Count how much ammo in differentwe've got left _ammocount = _plane ammo "RKTR27Launcher"; ...... ...... ...... }; if(_ammoname == "RKT_R73_AA") then { //Count how much ammo in differentwe've got left _ammocount = _plane ammo "RKTR73Launcher"; ..... ...... ...... }; }; Share this post Link to post Share on other sites