Adding more ammo to UH1H and Mi17 - Only One Gunner seat works?

Kevin-

Member
So I took the basis off this thread: http://opendayz.net/threads/release-bi-planes-with-m240s-on-1-7-7-1.12829/

I was tired of only starting with 100 bullets in the helicopters so I decided to attempt to just replace the vehicle class to the uh1h and mi17s anyways, my code is this...

Code:
if (_object isKindOf "UH1H_DZ") then {
                _object addMagazine "100Rnd_762x51_M240";
                _object addMagazine "100Rnd_762x51_M240";
                _object addMagazine "100Rnd_762x51_M240";
            };

But the issue is that it will only work for one gunner seat? So I don't really know how to specify the classname for like the crew chief seat or gunner seat.


Also it seems to be only working on helicopters that have spawned through the database, this is probably because the code that I have added was in the server_monitor.sqf... So for example lets say that I want a UH-1H that is spawned via the server.pbo, would I have to be something like...


Code:
_vehicle_99 = objNull;
if (true) then
{
  _this = createVehicle ["UH1H_DZ", [worldspace here], [], 0, "CAN_COLLIDE"];
  _vehicle_99 = _this;
  _this setDir -50.835873;
  _this setPos [worldspace here];
_object addMagazine "100Rnd_762x51_M240";
_object addMagazine "100Rnd_762x51_M240";
 _object addMagazine "100Rnd_762x51_M240";
};


If this would work, then would there be a better more efficient way of saying that all vehicles, will have more ammo? Anyways just some ideas and hopefully this discussion will help other players and myself in the process :)
 
How is the way to add more ammo from game in those vehicles? for example i have a MH60 with 2 M240 and mi player has a ammo magazine of M240 in their inventory. Did writing a property in the vehicle perhaps?
 
That is basically my question Jinete, I can add ammo to the vehicles in the server_monitor.sqf, but the problem is that if there is two gunner seats, only one seat gets the ammo.
 
Ok so I figured that if I wanted to add the ammo the vehicles that were spawned through the mission or server pbo. Then I have to include it in the sqf. This ended up working for me.

Code:
_vehicle_138 = objNull;
if (true) then
{
  _this = createVehicle ["UH1H_DZ", [worldspace], [], 0, "CAN_COLLIDE"];
  _vehicle_138 = _this;
  _this setDir -89.540604;
  _this setPos [worldspace];
  _this addMagazine "100Rnd_762x51_M240";
  _this addMagazine "100Rnd_762x51_M240";
};


Though this does work, it still leads me only adding ammo on one side? Any advice would be much appreciated.
 
Yes add database-no problem, the question is that can be added to the vehicle from the player hopefully someone knows how to do, thanks kevin.
 
Ok so I figured that if I wanted to add the ammo the vehicles that were spawned through the mission or server pbo. Then I have to include it in the sqf. This ended up working for me.

Code:
_vehicle_138 = objNull;
if (true) then
{
  _this = createVehicle ["UH1H_DZ", [worldspace], [], 0, "CAN_COLLIDE"];
  _vehicle_138 = _this;
  _this setDir -89.540604;
  _this setPos [worldspace];
  _this addMagazine "100Rnd_762x51_M240";
  _this addMagazine "100Rnd_762x51_M240";
};


Though this does work, it still leads me only adding ammo on one side? Any advice would be much appreciated.
Another action would be interesting to take ammunition from the helicopter to have it in your inventory, how could I do?
 
THANK YOU cyrq, for those who are curious using the adddmagazineturret classname ended up working.

Code:
_vehicle_138 = objNull;
if (true) then
{
  _this = createVehicle ["UH1H_DZ", [worlddspace], [], 0, "CAN_COLLIDE"];
  _vehicle_138 = _this;
  _this setDir -89.540604;
  _this setPos [worldspace];
  _this addMagazine "100Rnd_762x51_M240";
  _this addMagazine "100Rnd_762x51_M240";
  _this addMagazineTurret ["100Rnd_762x51_M240",[0]];
};
 
Back
Top