PDA

View Full Version : Ammo box drop script



S4Mz
Jun 18 2011, 01:53
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!

Demonized
Jun 18 2011, 07:06
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.

S4Mz
Jun 18 2011, 13:33
Tested it out and what you put in the act of the trigger comes up with a blank error...

hungrytoheal
Jun 18 2011, 17:18
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";
};

1PARA{God-Father}
Jun 18 2011, 17:26
If I was U just download the following script !

http://www.armaholic.com/page.php?id=10834

That will do what you need and more !

S4Mz
Jun 19 2011, 10:48
thanks Psvialli!