Jump to content
Sign in to follow this  
colinm9991

C-130J Carpet Bombing Script - isKeyActive

Recommended Posts

So I have this script

// Author: Nicolas
// version: 1.0


//variables
_bomb = "RHIB";
_bomb2 = "RHIB";
_plane = _this select 0;
_i= 0;
player globalChat format["%1","Bombs away!"];


//spawning bombs
for [{_i=1}, {_i<6}, {_i=_i+1}] do  //change 6 for whatever number of bombs you want the c-130 to be able to drop (here its  6x2 = 12 bombs)
{
_bomb = "Bo_GBU12_LGB" createVehicle [1000, 1000, 1000];
_bomb attachTo [_plane, [4, 0, -5]]; //spawn under left wing
sleep 0.01;  //allow the bomb to be attached before detaching it
detach _bomb;
sleep 0.15;


_bomb2 = "Bo_GBU12_LGB" createVehicle [1000, 1000, 1000];
_bomb2 attachTo [_plane, [-4, 0, -5]]; //spawn under right wing
sleep 0.01;  //allow the bomb to be attached before detaching it
detach _bomb2;
sleep 0.15;
};

//destroying variables
_bomb = nil;
_bomb2 = nil;
_plane = nil;
_i = nil;

Which I want to edit so that If joystick Fire/Main button is pressed, It'll keep dropping bombs until I release the button.

I've looked at 2 other threads, one which uses this exact same code, and another which has another person making his own code.

None could help me.

So far what I've managed to find is "activateKey" and "isKeyActive" functions from the Wiki, however I have no idea how to do them as I want.

I used to do some amateur programming for "San Andreas Multiplayer" which has the same style (C++) however they are completely different functions.

Anyone have any ideas on what to do?

And any idea how I can find out the code for my Joystick fire button from ArmA's list?

Share this post


Link to post
Share on other sites

Thank you.

Would there be any problem with just removing the following line

for [{_i=1}, {_i<6}, {_i=_i+1}] do  //change 6 for whatever number of bombs you want the c-130 to be able to drop (here its  6x2 = 12 bombs)

With let's say, something along the lines of "onMouseHolding" with extra coding,

I know (pretty obvious) that the line I'm speaking of, controls how many bombs are dropped when you pick the "Bombs Away!" option in the scroll wheel mouse menu

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  

×