CJLivs 0 Posted August 29, 2007 Can anyone help? I need a standalone script run from an event handler within the config of a addon which forces the unit to drop a rocket launcher after firing - similar to single shot launchers such as M72 LAWs or Panzerfausts. Anybody know of any? Many thanks Share this post Link to post Share on other sites
.kju 3245 Posted August 30, 2007 check WGL5.12 (wglevents.pbo) http://ofpc.de/wargames/ Share this post Link to post Share on other sites
HitmanFF 6 Posted August 30, 2007 UKF have made a LAW80 launcher that got dropped on the floor, and replaced with an empty one (to prevent being picked up again) after firing. Share this post Link to post Share on other sites
CJLivs 0 Posted August 30, 2007 Thanks for that, can't seem to unpack UKF files to get to scripts to see what they've done though. (Please note that i'm only doing work for my own use and don't intend to release anything) Currently i've got a problem where the AT launcher is being dropped when I fire any weapon. The eventhandler i'm using is; <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">fired ="[_this select 0,_this select 1]exec ""\fallschirmjaeger\drop.sqs"""; Â Â }; Â The drop script is as follow; <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 ~1 ?(_weapon == "I44_PzFaust"):goto "DropLaw" #DropLaw _unit action ["Drop Weapon",_unit,0,0,"I44_PzFaust"] goto "exit" #exit exit Anybody know how I make it so that this script only runs if the "I44_PzFaust" weapon is fired? Many thanks Share this post Link to post Share on other sites
HitmanFF 6 Posted August 30, 2007 There are two omissions in your drop script, as far as I can see. _weapon is not assigned any value, and you will always pass the #Droplaw part, because you don't jump over it in case the weapon is not the I44_PzFaust. I can't test it for you, but this should work better: <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 _weapon = _this select 1 ~1 ?(_weapon == "I44_PzFaust"):goto "DropLaw" goto "exit" #DropLaw _unit action ["Drop Weapon",_unit,0,0,"I44_PzFaust"] goto "exit" #exit exit One thing to consider is to remove all I44_PzFaust ammo from the player (at least if you're able to carry more than one rocket for it) after firing. Otherwise you'd be able to pick up the Paunzerfaust from the ground, reload and fire it again. Share this post Link to post Share on other sites
CJLivs 0 Posted September 1, 2007 I've just tried your scripts now and they work just perfectly. Many thanks for that HitmanFF! Once again the OFP community comes up trumps! Share this post Link to post Share on other sites