Jump to content
Sign in to follow this  
CJLivs

Droping rocket launchers

Recommended Posts

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

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

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

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

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! notworthy.gif

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×