Skip to content
Lee Hayward edited this page Jun 12, 2021 · 17 revisions

How do I add more named loadouts ? (i.e VIP Bronze)

That's beyond the scope of my FREE support or this Wiki. However, you can take a look at the init.c.merge-other-maps file in the root of my repository and figure it out from there. If you have a basic understanding of coding/scripting then you'll be okay. The part where you need to be careful is the loadout code block and the if else statement. Note: Since the initial release I've added an additional VIP loadout plus a Moderator loadout. That should be more than enough for most servers.

How do I add x_classname to a loadout ?

After: player.GetInventory().CreateInInventory(knifeArray.GetRandomElement());
Add: player.GetInventory().CreateInInventory("Classname");
Replace Classname with yours (i.e "Lockpick")

How do I add another random TStringArray ?

After: ref TStringArray meleeArray = {"FirefighterAxe"};
Add:

	ref TStringArray myrandomnameArray = {"Classname1","Classname2","etc"};
	player.GetInventory().CreateInInventory(myrandomnameArray.GetRandomElement());

myrandomnameArray can be whatever you want to call it, but it must match the Array name on the second line.

How do I add x number of classname ? (stackable items)

	ItemBase rags = player.GetInventory().CreateInInventory("Rag"); 
	rags.SetQuantity(4);

rags can be anything you want, but it must match the name on the second line.

How do I add an inventory item with an attachment ?

	ItemBase light = player.GetInventory().CreateInInventory("Flashlight");
	light.GetInventory().CreateAttachment("Battery9V");

light can be anything you want, but it must match the name on the second line.

How do I give the player a gun with attachments ?

	EntityAI gun = player.GetInventory().CreateInInventory("AKM");	
	gun.GetInventory().CreateAttachment("AK_RailHndgrd");		 
	ItemBase gunlight = gun.GetInventory().CreateAttachment("UniversalLight");	
	gunlight.GetInventory().CreateAttachment("Battery9V");			

This example is already included in the config files.

How can I set a chance that the user won't spawn with a Hat ? (for example)

        ref TStringArray hatArray = {"BaseballCap_CMMG_Pink","","","BaseballCap_Blue","",""};

Empty quotes will spawn nothing, so in this example there are 4 in 6 chances of spawning without a hat.