Jump to content
Sign in to follow this  
S4Mz

Ammo box drop script

Recommended Posts

Hello Im looking for a script in which I as a pilot can get into a blackhawk chopper and be able to drop a custom ammo box from my chopper for my other players to be able to use if they need more ammunition and then obviously it despawn after a appropriate amount of time. Im not looking for anything to fancy like it falling with an parachute although it would be nice it would add to the realism of my mission but I would be happy with it just to eb able to drop out of the chopper and fall to the ground :)

Thanks!

Share this post


Link to post
Share on other sites

place in init of heli, so only pilot can see it.

_idx = this addAction ["Drop ammobox", "dropAmmo.sqf", [], 0, false, true, "", "driver _target == _this"];

create a script named dropAmmo.sqf in it place this:

Dropping_Ammo = true;
publicVariable "Dropping_Ammo";
Dropper_array = [(_this select 1)];
publicVariable "Dropper_array";

in init.sqf place this:

Dropping_Ammo = false;
Dropper_array = [];

now have a repeated trigger and in condition:

Dropping_Ammo

in on act:

Dropping_Ammo = false;
publicVariable "Dropping_Ammo";
_null = [] spawn {
if (isServer) exitWith {};
waitUntil {(count Dropper_array) != 0};
_dropper = Dropper_array select 0;
_box = "USBasicWeaponsBox" createVehicleLocal [getPos (vehicle _dropper) select 0, getPos (vehicle _dropper) select 1, (getPos (vehicle _dropper) select 2) - 2];
if ((getPos _box select 2) < 0) then {_box setPos [getpos _box select 0, getPos _box select 1, 0];
_null = _box execVM "ammoFillerScriptOfChoise.sqf";
Dropper_array = [];
publicVariable "Dropper_array";
};

change the higlighted ammobox name for your box of choise, this one is A2 usmc type.

change the higlighted "ammoFillerScriptOfChoise.sqf" to whatever ammo filler script of choise, there are many out there.

untested, but should work, let me know and ill test myself if its not working.

Share this post


Link to post
Share on other sites

Tested it out and what you put in the act of the trigger comes up with a blank error...

Edited by S4Mz

Share this post


Link to post
Share on other sites

Try creating a script.

On activation:

_name exec nameofscript.sqs

Dropping_Ammo = false;
publicVariable "Dropping_Ammo";
_null = [] spawn {
if (isServer) exitWith {};
waitUntil {(count Dropper_array) != 0};
_dropper = Dropper_array select 0;
_box = "USBasicWeaponsBox" createVehicleLocal [getPos (vehicle _dropper) select 0, getPos (vehicle _dropper) select 1, (getPos (vehicle _dropper) select 2) - 2];
if ((getPos _box select 2) < 0) then {_box setPos [getpos _box select 0, getPos _box select 1, 0];
_null = _box execVM "ammoFillerScriptOfChoise.sqf";
Dropper_array = [];
publicVariable "Dropper_array";
};

Share this post


Link to post
Share on other sites

thanks Psvialli!

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  

×