Jump to content
Sign in to follow this  
Xtreme Serb

Blank Fireing Attachments

Recommended Posts

Anyone aware of a script to make your firearm fire blanks, so you have a muzzle flash and weapon sound, but no bullet expended? notworthy.gifnotworthy.gif

Share this post


Link to post
Share on other sites

cannot think of a way to do that as a script...but as an addon it could probably be done.

Share this post


Link to post
Share on other sites

hmm, add eventhandler "fired" and delete the bullet?

pistols.gif  yay.gif

QuietMan

Share this post


Link to post
Share on other sites

Oh come on this is a one-liner:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this addEventhandler ["fired",{deleteVehicle (nearestObject [_this select 0,_this select 4])}];

Add that to any unit or vehicle's init and it'll be shootin blanks. Blank grenades and rockets too unless you give the code more specific paramters.

{USI}_Zombie, fired EH never occured to you? icon_rolleyes.gif

Share this post


Link to post
Share on other sites

any way for it to happen to all players, controlled by a radio command?

ie, u hit radio alhpa, and all players turn into blank ammo?

Share this post


Link to post
Share on other sites
any way for it to happen to all players, controlled by a radio command?

ie, u hit radio alhpa, and all players turn into blank ammo?

hmm, I think then it is simpler to remove all Mags

QuietMan

Share this post


Link to post
Share on other sites
{USI}_Zombie, fired EH never occured to you? icon_rolleyes.gif

erm, actually not...I really haven't gotten my brain around eventhandlers yet  whistle.gif   guess I need an egg-on-face smilie

Share this post


Link to post
Share on other sites

KyleSarnik, you come over as a pretentious twat at times.

The best way to do blanks in my opinion would be to make some new magazines and ammo classes. Set them up to fire harmless ammo very slowly but still make all the flashes and bangs etc.

Problem is, another addon is another addon. So unless you plan on making a lot of missions with this stuff in it, why bother.

Share this post


Link to post
Share on other sites
any way for it to happen to all players, controlled by a radio command?

ie, u hit radio alhpa, and all players turn into blank ammo?

What do you mean? Players or all units?

For certain units by following KyleSarnik's example:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">man1 addEventhandler ["fired",{deleteVehicle (nearestObject [_this select 0,_this select 4])}]; man2 addEventhandler ["fired",{deleteVehicle (nearestObject [_this select 0,_this select 4])}]

Or by using 'foreach'-command for certain group (haven't tested, but should work):

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{_x addEventhandler ["fired",{deleteVehicle (nearestObject [_this select 0,_this select 4])}]} foreach units player

Or certain trigger conditions:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{_x addEventhandler ["fired",{deleteVehicle (nearestObject [_this select 0,_this select 4])}]} foreach list trigger

... Or by many ways that doesn't cross to my mind.

Share this post


Link to post
Share on other sites
KyleSarnik, you come over as a pretentious twat at times.

The best way to do blanks in my opinion would be to make some new magazines and ammo classes. Set them up to fire harmless ammo very slowly but still make all the flashes and bangs etc.

Problem is, another addon is another addon. So unless you plan on making a lot of missions with this stuff in it, why bother.

Well I can already tell your opinion is not always in agreement with most of the other people here. I have no problem about what's best in your opinion, but I can guarantee you a fired EH will provide Xtreme Serb with a much more effective and simple solution for what he needs. Using my method basically gives you all the side-effects of pulling the trigger except for a bullet leaving the barrel (and best of all no addons required).

And to follow up with your question about a radio trigger, of course. There are of course a few different ways to do it, but IMO the best way for your situation (actually I'm not entirely sure what your situation is so I'm going to picture what it would be, and just give you the most foolproof method I can think of) is with 2 triggers:

First, create a big trigger with a radius that covers the entire playing area (wherever the players will be at any given point, could potentially be the whole island but no problem, triggers can be that big), activated by Anybody Present. Name it something (in the name field), ex: PlayerList.

Next create your radio trigger (looks like you already know how to do that), and in the On Act(ivation) field write (or, I recommend copy/paste):

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{{if(isPlayer _X)then{_X addEventhandler ["fired",{deleteVehicle (nearestObject [_this select 0,_this select 4])}]}} forEach (crew _X)} forEach (list PlayerList)

Using the name you chose for your first trigger in place of PlayerList, if you didn't use that name of course. This will also make sure any players hiding inside of vehicles will be given the blank firing treatment.

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  

×