Jump to content
weaponsfree

Individual Units Changes Gear after Entering Vehicle

Recommended Posts

I am trying to get units to change gear and activate setcaptive true when they enter a specific vehicle.

 

The player will be able to select units from his group to add to the vehicle, so that only units that are actually in the vehicle get the gear change and setcaptive.

 

Right now I'm thinking of attaching a trigger to the vehicle that has a thislist script to change the gear. But even this requires some scripting that is a little beyond my skills.

 

If possible, this should only occur when first entering the vehicle, to avoid a reset of the gear each time a unit enters.

Any help on how to accomplish this would be greatly appreciated!

As a reference, this is the gear I want players to receive upon entering (on top of the setcaptive true) :

removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
this forceAddUniform "U_Competitor";
this addItemToUniform "FirstAidKit";
this addItemToUniform "30Rnd_556x45_Stanag";
this addVest "V_Rangemaster_belt";
for "_i" from 1 to 4 do {this addItemToVest "30Rnd_556x45_Stanag";};
this addHeadgear "H_Cap_blk_ION";
this addWeapon "arifle_SPAR_01_blk_F";
this addPrimaryWeaponItem "optic_Holosight_blk_F";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
 

Share this post


Link to post
Share on other sites

What you are trying to do is probably better done with GetIn and/or GetInMan event handler than with trigger. You will have less code and more precision in what unit causes changes. Keep an eye on locality: where handlers are added and where they hit.

  • Like 1

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

×