Jump to content
  • 0

Adding reload option to vehicles that normally autorefill


BetterDeadThanZed

Question

I use this method to strip ammo from non-Epoch armed vehicles: 

 

I would like to add the ammo that it strips to the traders, but a problem is that these vehicles don't have reload options because you don't normally have to reload them.

 

For example, the Mi24_D_TK_EP1 has 7 different magazine types. Even if I can buy the ammo at the trader, I can't load it. Is there a way to add a reload option to these vehicles?

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

I'm not using a service point.

If you want cursor target option or nearest, this is how I did it

 

 

its verry rough code but it worked for me....

If you clean it up please share 

 

fn_selfActions.sqf

 

_isalb = cursorTarget isKindOf "Mi24_D_TK_EP1 ";
_mgQTY = {_x == "1470Rnd_127x108_YakB"} count magazines player;

if (_mgQTY >= 2 and  _isalb) then {
    if (s_player_litl < 0) then {
        s_player_litl = player addAction ["add 1470Rnd_127x108_YakB x2","custom\Mi24.sqf",cursorTarget, 0, false, true, "",""];
    };
} else {
        player removeAction s_player_litl;
        s_player_litl = -1;
};

in custom\Mi24.sqf

 

private ["_lilbird","_isalb","_mgQTY"];

_lilbird = nearestObject [player, "Mi24_D_TK_EP1 "];
_isalb = cursorTarget isKindOf "Mi24_D_TK_EP1 ";
_mgQTY = {_x == "1470Rnd_127x108_YakB"} count magazines player;
_sounddist = 20;
_dis=100;
if (_mgQTY >= 2) then {

player playActionNow "Medic";
sleep 1;
[player,"combo_unlock",0,false] call dayz_zombieSpeak;
sleep 1;
playsound "MinigunReload";//   this is not working ;(
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;

player removeMagazine "1470Rnd_127x108_YakB";
player removeMagazine "1470Rnd_127x108_YakB";

_lilbird removeMagazinesTurret ["1470Rnd_127x108_YakB",[0]];
_lilbird removeMagazinesTurret ["1470Rnd_127x108_YakB",[1]];

_lilbird addMagazineTurret ["1470Rnd_127x108_YakB",[0]];
_lilbird addMagazineTurret ["1470Rnd_127x108_YakB",[1]];

_lilbird addMagazine "1470Rnd_127x108_YakB";
_lilbird addMagazine "1470Rnd_127x108_YakB";

systemchat "You have added a magazine to the little bird.";

} else {
systemchat "You do not have B_127x108_APHE ammo in your inventory.";
};
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...