Jump to content
Sign in to follow this  
RyanTurner

CfgRoles, CfgRespawnInventory and BIS_fnc_addRespawnInventory

Recommended Posts

Good afternoon to everyone,

 

I've been going all over this I don't get it how could I could do it and wanted to ask if it's possible.

 

So I've 2 Roles and 4 Loadouts

 

Roles: 

SL - M4 

SL - M16

Loadouts
SL: M4 - Light

SL: M4 - Medium

SL: M16 - Light

SL: M16 - Medium

 

I just want X Person to have Y loadouts, so I just want have Squad Leader to have the choice from the Roles M4 or M16 and their respective Loadouts JUST for him and no one else.

 

While works fine, if I wanted to add another 

[usa_squadleader, "USA_SquadLeader_Light_M4"] call BIS_fnc_addRespawnInventory;

If i add another line to do this:

[usa_squadleader, "USA_SquadLeader_Light_M4"] call BIS_fnc_addRespawnInventory;
[usa_squadleader, "USA_SquadLeader_Light_M16"] call BIS_fnc_addRespawnInventory;

when I start the mission it gives me the following error:

[BIS_fnc_addRespawnInventory] USA_SquadLeader_Light_M16' not found in CfgRespawnInventory or CfgVehicles

I've tried array but from what I see it can't be as normal array as _array = [loadout1, loadout2] then add that instead of the class name.

 

This is my description.ext

class CfgRoles
{
	class USA_SquadLeader_M4 // M4 Loadouts
	{
		displayName = "Squad Leader - M4 ";
        icon = "\A3\Ui_f\data\GUI\Cfg\Ranks\sergeant_gs.paa";
	};

	class USA_SquadLeader_M16 // M16 Loadouts
	{
		displayName = "Squad Leader - M16 ";
        icon = "\A3\Ui_f\data\GUI\Cfg\Ranks\sergeant_gs.paa";
	};
};
 
class CfgRespawnInventory
{	
	// M4s Loadouts
	class USA_SquadLeader_Light_M4
	{
		displayName = "M4 - Light";									
		icon = "\A3\Ui_f\data\GUI\Cfg\Ranks\sergeant_gs.paa";	
		role = "USA_SquadLeader_M4";	
	};

	class USA_SquadLeader_Medium_M4 
	{
		displayName = "M4 - Medium";									
		icon = "\A3\Ui_f\data\GUI\Cfg\Ranks\sergeant_gs.paa";	
		role = "USA_SquadLeader_M4";	
	};

	// M16s Loadouts
	class USA_SquadLeader_Light_M16
	{
		displayName = "M4 - Light";									
		icon = "\A3\Ui_f\data\GUI\Cfg\Ranks\sergeant_gs.paa";	
		role = "USA_SquadLeader_M16";	
	};

	class USA_SquadLeader_Medium_M16 
	{
		displayName = "M4 - Medium";									
		icon = "\A3\Ui_f\data\GUI\Cfg\Ranks\sergeant_gs.paa";	
		role = "USA_SquadLeader_M16";	
	};
};

 

and my initServer.sqf

[usa_squadleader, "USA_SquadLeader_Light_M4"] call BIS_fnc_addRespawnInventory;
[usa_squadleader, "USA_SquadLeader_Light_M16"] call BIS_fnc_addRespawnInventory;

With the 2nd one It doesn't work, i wanted to add M4s and M16s loadouts to only the squad leader.

 

My multiplayer options: 

Imgur

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  

×