• 0
Sign in to follow this  
hectorPlusPlus

Adding Weapons to Vehicles

Question

Im trying to add Weapons to Vehicles, and before you tell me to use Arma 3's default vehicles.... NO!

Bohemia has this

https://community.bistudio.com/wiki/addWeapon

and i have followed this and I am getting no errors in RPT and server is still operating as usual, I am Running Exile 1.0.4a, all the RHS's, TRYK, CUP Terrains and Maps, RyansZombies, Chernarus2035, CBA,NI ARMS and EBM

Dispite the mods i have tried this previously and never have i gotten it to work

I have also Watched this video, it is related, but not helpful 

 

Share this post


Link to post
Share on other sites

2 answers to this question

  • 0

Hello @hectorPlusPlus,

One thing to mention is if you use InfiSTAR.  I know in some cases, it can block the adding of items.

While I am 'weak' on MP scripting, I am 'so-so' with SP scripting.  In a mod that I wrote and use, I wrote a sub-script which does what you want.

This script works on the vehicle in which you are sitting in, so you will have to modify it, maybe.

 

***********************************

; Load out players vehicle

_vehicle = (vehicle player);

clearItemCargoGlobal _vehicle;

_vehicle addItemCargoGlobal ["11Rnd_45ACP_Mag",100];
_vehicle addItemCargoGlobal ["10Rnd_93x64_DMR_05_Mag",100];
_vehicle addItemCargoGlobal ["150Rnd_93x64_Mag",100];
_vehicle addItemCargoGlobal ["HandGrenade",100];
_vehicle addItemCargoGlobal ["Titan_AT",100];
_vehicle addItemCargoGlobal ["Titan_AA",100];
_vehicle addItemCargoGlobal ["FirstAidKit",50];

_vehicle addItemCargoGlobal ["srifle_GM6_camo_F",25];
_vehicle addItemCargoGlobal ["5Rnd_127x108_APDS_Mag",100];

_vehicle addItemCargoGlobal ["SMG_05_F",25];
_vehicle addItemCargoGlobal ["30Rnd_9x21_Mag_SMG_02",100];

_vehicle addItemCargoGlobal ["arifle_MX_SW_khk_F",25];
_vehicle addItemCargoGlobal ["100Rnd_65x39_caseless_mag",100];

_vehicle addItemCargoGlobal ["launch_O_Titan_short_ghex_F",25];
_vehicle addItemCargoGlobal ["launch_O_Titan_ghex_F",25];

_vehicle addItemCargoGlobal ["srifle_DMR_05_blk_F",25];
_vehicle addItemCargoGlobal ["10Rnd_93x64_DMR_05_Mag",100];

_vehicle addItemCargoGlobal ["MMG_01_hex_F",25];

_vehicle addItemCargoGlobal ["SatchelCharge_Remote_Mag",100];

_vehicle addItemCargoGlobal ["acc_pointer_IR",25];
_vehicle addItemCargoGlobal ["optic_Nightstalker",25];
_vehicle addItemCargoGlobal ["muzzle_snds_H",25];
_vehicle addItemCargoGlobal ["optic_ACO_grn",25];
_vehicle addItemCargoGlobal ["bipod_01_F_blk",25];
_vehicle addItemCargoGlobal ["NVGogglesB_grn_F",25];
_vehicle addItemCargoGlobal ["muzzle_snds_93mmg",25];
_vehicle addItemCargoGlobal ["B_UavTerminal",25];


hint format ["%1 Loaded Out!",_vehicle];


_vehicle="";

***********************************

The above script will clear out a vehicle's current load and replace it with the above items.

:)

 

 

Share this post


Link to post
Share on other sites
  • 0

What you will want to do is override ExileServer_object_carefulCreateVehicle in CfgExileCustomeCode.
Then use this anywhere in there:

if(_vehObj isKindOf "B_Heli_Light_01_armed_F") then
{
    _vehObj removeWeaponTurret      ["missiles_DAR",[-1]];
    _vehObj removeMagazinesTurret   ["24Rnd_missiles",[-1]];
    _vehObj removeWeaponTurret    ["M134_minigun",[-1]];
    _vehObj removeMagazinesTurret ["5000Rnd_762x51_Belt",[-1]];
    _vehObj addWeaponTurret         ["LMG_Minigun_Transport",[-1]];
    _vehObj addMagazineTurret       ["2000Rnd_65x39_Belt",[-1]];
    _vehObj addMagazineTurret       ["2000Rnd_65x39_Belt",[-1]];
    _vehObj addWeaponTurret         ["CMFlareLauncher",[0]];
    _vehObj addWeaponTurret         ["CMFlareLauncher",[-1]];
    _vehObj addMagazineTurret       ["60Rnd_CMFlare_Chaff_Magazine",[0]];
    _vehObj addMagazineTurret       ["60Rnd_CMFlare_Chaff_Magazine",[-1]];
};

In the if condition, change that to the class of the vehicle you want.
In the If statement change it to the weapon and ammunition you want.
Cfg Class Codes

Helpful Weapon and Ammo additions
 

Use -1 in the second argument for the driver, then 0 and up for other seats.

Side note: 
You can also use removeWeaponTurret ["Weapon",[_position]]; to remove weapons aswell.

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.