Jump to content
Zakuaz

Add multiple boxes of 2 types of ammo, possible?

Recommended Posts

I am familiar with the "this addMagazineTurret ["140Rnd_30mm_MP_shells_Tracer_Green",[1,2]];" and placing it in a vehicles init field.

 

But I want to add that plus a few boxes of the other 30mm AP rounds "60Rnd_30mm_APFSDS_shells_Tracer_Green" as well... so far my hack job attempts have failed.

Can anyone show me how that line of code should look to enable multiple boxes of two different types of ammo?

Share this post


Link to post
Share on other sites

0 = { this addMagazineTurret ["60Rnd_30mm_APFSDS_shells_Tracer_Green",[0]] } count [1,2];  // check for the right turret [0] or else... I don't know your vehicle.

  • Like 2

Share this post


Link to post
Share on other sites

The vehicle is the Kamysh.

 

Oh my example was bad to begin with sorry about that, {this addMagazineTurret ["140Rnd_30mm_MP_shells_Tracer_Green",[0]]} foreach [1,2]

 

I had tried a cold guess with {this addMagazineTurret ["140Rnd_30mm_MP_shells_Tracer_Green","60Rnd_30mm_APFSDS_shells_Tracer_Green",[0]]} foreach [1,2]  but that didnt do anything, imagine that haha.

Share this post


Link to post
Share on other sites
{this addMagazineTurret ["140Rnd_30mm_MP_shells_Tracer_Green",[0]];} forEach [1,2];
{this addMagazineTurret ["60Rnd_30mm_APFSDS_shells_Tracer_Green",[0]];} forEach [1,2,3,4];

Adds 2 magazines of MP ammo and 4 magazines of APFSDS ammo to the main turret

  • Like 1

Share this post


Link to post
Share on other sites

Literally that straight forward eh?

Seems like I tried that BUT I probably had something wrong in it.

Thanks Sgt, I'll give it a go!

Share this post


Link to post
Share on other sites
On 7/3/2019 at 10:04 PM, pierremgi said:

0 = { this addMagazineTurret ["60Rnd_30mm_APFSDS_shells_Tracer_Green",[0]] } count [1,2];  // check for the right turret [0] or else... I don't know your vehicle.

How do i use this in a sqf.file?  Dear pierremgi 🍀

 

0 = { this addMagazineTurret ["12Rnd_230mm_rockets",[0]] } count [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60];

 

my sqf.file            The problem //????

 

Czamak1.sqf

 

if (!isServer) exitWith {};  

 

_veh = _this #0; _veh addEventHandler ["Fired", {_this execVM "trackShell.sqf";}];    
_veh = _this #0; _veh setObjectTextureGlobal [0,'\A3\soft_f_beta\Truck_02\Data\Truck_02_kab_OPFOR_co.paa'];     
_veh = _this #0; _veh setObjectTextureGlobal [2,'\A3\Static_F_Sams\Radar_System_02\Data\Radar_system_02_mat_02_CO.paa'];
//???? 0 = { this addMagazineTurret ["12Rnd_230mm_rockets",[0]] } count [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60];
_veh = _this #0; _veh allowCrewInImmobile true; 

 

 

I use a jebus respawn script.

 

vehicle init.

 

0 = [this,"DELAY=",1800, "INIT=", "[vehicle _proxyThis] execVM 'Czamak1.sqf' "]  spawn jebus_fnc_main;

 

 

You've helped me before, so you're a natural victim 🤩

 

 

 

 

Share this post


Link to post
Share on other sites

You only need to define "_veh" once.
"_veh" is the variable used to reference the vehicle.

//Czamak1.sqf

if (!isServer) exitWith {};  

_veh = _this #0; 
_veh addEventHandler ["Fired", {_this execVM "trackShell.sqf";}];    
_veh setObjectTextureGlobal [0,'\A3\soft_f_beta\Truck_02\Data\Truck_02_kab_OPFOR_co.paa'];     
_veh setObjectTextureGlobal [2,'\A3\Static_F_Sams\Radar_System_02\Data\Radar_system_02_mat_02_CO.paa'];
_veh allowCrewInImmobile true; 

{ _veh addMagazineTurret ["12Rnd_230mm_rockets",[0]] } count [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60];

Much easier to write:

//Czamak1.sqf

if (!isServer) exitWith {};  

_veh = _this #0; 
_veh addEventHandler ["Fired", {_this execVM "trackShell.sqf";}];    
_veh setObjectTextureGlobal [0,'\A3\soft_f_beta\Truck_02\Data\Truck_02_kab_OPFOR_co.paa'];     
_veh setObjectTextureGlobal [2,'\A3\Static_F_Sams\Radar_System_02\Data\Radar_system_02_mat_02_CO.paa'];
_veh allowCrewInImmobile true;

for "_i" from 1 to 60 do {_veh addMagazineTurret ["12Rnd_230mm_rockets",[0]]};

 

  • Like 1

Share this post


Link to post
Share on other sites
18 hours ago, Harzach said:

You only need to define "_veh" once.
"_veh" is the variable used to reference the vehicle.


//Czamak1.sqf

if (!isServer) exitWith {};  

_veh = _this #0; 
_veh addEventHandler ["Fired", {_this execVM "trackShell.sqf";}];    
_veh setObjectTextureGlobal [0,'\A3\soft_f_beta\Truck_02\Data\Truck_02_kab_OPFOR_co.paa'];     
_veh setObjectTextureGlobal [2,'\A3\Static_F_Sams\Radar_System_02\Data\Radar_system_02_mat_02_CO.paa'];
_veh allowCrewInImmobile true; 

{ _veh addMagazineTurret ["12Rnd_230mm_rockets",[0]] } count [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60];

Much easier to write:


//Czamak1.sqf

if (!isServer) exitWith {};  

_veh = _this #0; 
_veh addEventHandler ["Fired", {_this execVM "trackShell.sqf";}];    
_veh setObjectTextureGlobal [0,'\A3\soft_f_beta\Truck_02\Data\Truck_02_kab_OPFOR_co.paa'];     
_veh setObjectTextureGlobal [2,'\A3\Static_F_Sams\Radar_System_02\Data\Radar_system_02_mat_02_CO.paa'];
_veh allowCrewInImmobile true;

for "_i" from 1 to 60 do {_veh addMagazineTurret ["12Rnd_230mm_rockets",[0]]};

 

thank you, I don't know what I'm doing, I only write in here when I'm desperate, I'm just picking parts out of people's script and being hopeful 😄 but the Much easier to write dont work, but the first one does.

 

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

×