Jump to content
Sign in to follow this  
schadler17

Ammobox Gear based on Player Class

Recommended Posts

I'm creating an Ammobox script that will deploy different types of gear based on what class the ammobox is.

It all works and I can create different boxes with different layouts. My question is, how would I make it so when a certain class opens the box, a certain list of items would appear, only for that players classname.

 

So far, this is what I've got, and it deploys the Weapons/Ammo/Items I place in the arrays like I wanted, but now I want to restrict certain gear to only be seen by certain classes.

// Ammo Box Loadout Based On Classname
// Written by Schadler.C [TacBF Team]

if (!isServer) exitWith {};

private ["_box", "_type"];
_box = _this select 0;
_type = (typeOf _box);

// Begin Ammobox Supplies

while {alive _box} do {
	
	switch (_type) do {

		// Ammo Box 1
		
			case "rhsusf_weapon_crate": {
			
				// Refresh Ammobox (Keeps From Duplication)
				
					clearMagazineCargo _box;
					clearWeaponCargo _box;
					clearItemCargoGlobal _box;
				
				// Weapons
					
					_box addWeaponCargoGlobal [""]
				
				// Ammo
				
					_box addMagazineCargoGlobal [""];
				
				// Items
				
					_box addItemCargoGlobal [""];
					
				sleep 60; // Box refresh timer
			
			};

	};
};

Share this post


Link to post
Share on other sites

I was looking at this Already and had something working, but messed it up and couldn't find out what I did wrong to it so I decided to rewrite what I had messed up lol. Thank you though, will post if I need further help setting it up.

Share this post


Link to post
Share on other sites

ignore. I'm gonna be writing a gear restriction on players anyways, so no need for boxes to show specific gear by player class, now it'll just be per box type(weapons, ammo, equipment, radios, etc..)

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
Sign in to follow this  

×