Kackarot58 2 Posted October 2, 2018 EntityAI assaultClass(PlayerBase player) { EntityAI gun = player.GetHumanInventory().CreateInHands("M4A1"); gun.GetInventory().CreateAttachment("M4_RISHndgrd_Black"); gun.GetInventory().CreateAttachment("M4_MPBttstck_Black"); gun.GetInventory().CreateAttachment("ACOGOptic"); addMags(player, "Mag_STANAG_30Rnd", 3); return gun; } If I used this class more than once I get a error popup before the server even starts. Can i use different ones or do I need to create moar? Share this post Link to post Share on other sites
SilvioDoHOTS 1 Posted October 2, 2018 Yes, you can as much as you want. You just need to do it propely. Which error do you get? Share this post Link to post Share on other sites
Aussie Cleetus 57 Posted October 2, 2018 (edited) I suspect the error would be one that says the Entity is declared multiple times. If you look through the original code for the multiple class loadouts, each class is named differently, and called at random in a select case statement // This is pseudo code, not directly implementable. You must add and adjust things as needed. // these go inside the class, but outside of functions EntityAI classOne (PlayerBase player) { // class One Code here return gun; } EntityAI classTwo (PlayerBase player) { // class Two Code here return gun; } EntityAI classThree (PlayerBase player) { // class Three Code here return gun; } // This goes inside the trigger code where you are adding the gear EntityAI yourGunEntity; Select (Math.Rand(0, 2)) { case 0: yourGunEntity = classOne(player); break; case 1: yourGunEntity = classTwo(player); break; case 2: yourGunEntity = classThree(player); break; } Edited October 2, 2018 by Aussie Cleetus 1 Share this post Link to post Share on other sites
Kackarot58 2 Posted October 2, 2018 Thanks! I will report back when I get a chance to try new loadouts. Is there a list of actually working guns for the server files? Share this post Link to post Share on other sites
Aussie Cleetus 57 Posted October 3, 2018 yeah, check Types.xml anything that is in there, works (as long as you haven't added new things). Share this post Link to post Share on other sites
arniegames4u 0 Posted October 10, 2018 On 10/2/2018 at 6:49 AM, Aussie Cleetus said: I suspect the error would be one that says the Entity is declared multiple times. If you look through the original code for the multiple class loadouts, each class is named differently, and called at random in a select case statement // This is pseudo code, not directly implementable. You must add and adjust things as needed. // these go inside the class, but outside of functions EntityAI classOne (PlayerBase player) { // class One Code here return gun; } EntityAI classTwo (PlayerBase player) { // class Two Code here return gun; } EntityAI classThree (PlayerBase player) { // class Three Code here return gun; } // This goes inside the trigger code where you are adding the gear EntityAI yourGunEntity; Select (Math.Rand(0, 2)) { case 0: yourGunEntity = classOne(player); break; case 1: yourGunEntity = classTwo(player); break; case 2: yourGunEntity = classThree(player); break; } hey there! thanks for throwing this together! I'm trying to use it but seem to be having an issue compiling the case 0: it says I'm missing a ;... any thoughts? Share this post Link to post Share on other sites
Aussie Cleetus 57 Posted October 11, 2018 Psuedo code means copy/paste won't work. Try providing your offending code and I can try to fix it Share this post Link to post Share on other sites