After using this code to delete all characters equipment in runtime. The next Code Compile Crashes.
class ARU_ScriptedUserAction_UI_Test: ARU_ScriptedUserAction { //------------------------------------------------------------------------------------------------ override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity) { // Deleting all cloth slots entities BaseLoadoutManagerComponent loadoutMan = BaseLoadoutManagerComponent.Cast(pUserEntity.FindComponent(BaseLoadoutManagerComponent)); if(!loadoutMan) return; IEntity ent0 = loadoutMan.GetClothByArea(LoadoutBackpackArea); IEntity ent1 = loadoutMan.GetClothByArea(LoadoutBootsArea); IEntity ent2 = loadoutMan.GetClothByArea(LoadoutHeadCoverArea); IEntity ent3 = loadoutMan.GetClothByArea(LoadoutJacketArea); IEntity ent4 = loadoutMan.GetClothByArea(LoadoutPantsArea); IEntity ent5 = loadoutMan.GetClothByArea(LoadoutVestArea); IEntity ent6 = loadoutMan.GetClothByArea(LoadoutBinocularsArea); IEntity ent7 = loadoutMan.GetClothByArea(LoadoutCoverArea); IEntity ent8 = loadoutMan.GetClothByArea(LoadoutGooglesArea); IEntity ent9 = loadoutMan.GetClothByArea(LoadoutWatchArea); loadoutMan.Unwear(ent0); loadoutMan.Unwear(ent1); loadoutMan.Unwear(ent2); loadoutMan.Unwear(ent3); loadoutMan.Unwear(ent4); loadoutMan.Unwear(ent5); loadoutMan.Unwear(ent6); loadoutMan.Unwear(ent7); loadoutMan.Unwear(ent8); loadoutMan.Unwear(ent9); // Deleting all weapon slots entities BaseWeaponManagerComponent weaponMan = BaseWeaponManagerComponent.Cast(pUserEntity.FindComponent(BaseWeaponManagerComponent)); if(!weaponMan) return; array<IEntity> outWeapons = {}; weaponMan.GetWeaponsList(outWeapons); foreach (IEntity weaponEntity : outWeapons) { SCR_EntityHelper.DeleteEntityAndChildren(weaponEntity); } } };