Для исправления ошибки CS1061, связанной с отсутствием свойства "Value" у типа "uint", вам нужно просто удалить ".Value" после "entity.net.ID", поскольку тип "uint" не имеет свойства "Value".
Вот исправленный фрагмент кода:
C#:
private void OnLootEntity(BasePlayer player, LootContainer entity)
{
if (player == null || entity == null || entity?.net?.ID == null || _lootEntity.Contains(entity.net.ID)) return;
var data = GetPlayerData(player.userID);
if (data == null) return;
data.Point += config._PointsSettings.pBarrel;
data.Gather["loot-barrel"]++;
_lootEntity.Add(entity.net.ID);
}
private void OnPlayerDeath(BasePlayer player, HitInfo info)
{
if (player == null || info == null || !player.userID.IsSteamId()) return;
if (info.damageTypes.Has(DamageType.Suicide))
{
var data = GetPlayerData(player.userID);
if (data == null) return;
data.Point -= config._PointsKillDeath.pSuicide;
data.Death++;
return;
}
}
Скопируйте этот исправленный код и замените им соответствующие части в вашем файле "BStats.cs". Это должно помочь устранить ошибку CS1061.
Исправь ошибку XDStatistics.cs(2499,64): error CS0117: `Oxide.Game.Rust.Cui.CuiImageComponent' does not contain a definition for `ItemId'
var weaponTop = statInfo.weapon.WeaponUsed.OrderByDescending(x => x.Value.Kills).Take(1).FirstOrDefault();
if (weaponTop.Key != null)
{
container.Add(new CuiLabel
{
RectTransform = { AnchorMin = "0 0.5", AnchorMax = "0 0.5", OffsetMin = "46.321 -16.5", OffsetMax = "176.509 16.5" },
Text = { Text = GetLang("STAT_UI_FAVORITE_WEAPON_KILLS", player.UserIDString, weaponTop.Value.Kills, weaponTop.Value.Shots), Font = "robotocondensed-regular.ttf", FontSize = 10, Align = TextAnchor.MiddleCenter, Color = "1 1 1 1" }
}, "FAVORITE_WEAPON_STAT_PLAYER", "LABEL_KILL_AMOUNT");
container.Add(new CuiElement
{
Name = "WEAPON_IMG_USER",
Parent = "FAVORITE_WEAPON_STAT_PLAYER",
Components = {
new CuiImageComponent { Color = "1 1 1 1", ItemId = GetItemId(weaponTop.Key) },
// new CuiRawImageComponent { Color = "1 1 1 1", Png = GetImage(weaponTop.Key + 50) },
new CuiRectTransformComponent { AnchorMin = "0.5 0.5", AnchorMax = "0.5 0.5", OffsetMin = "-88.5 -16.5", OffsetMax = "-55.5 16.5" }
}
});
}
else
{
container.Add(new CuiLabel
{
RectTransform = { AnchorMin = "0 0", AnchorMax = "1 1" },
Text = { Text = GetLang("STAT_UI_FAVORITE_WEAPON_NOT_DATA", player.UserIDString), Font = "robotocondensed-regular.ttf", FontSize = 10, Align = TextAnchor.MiddleCenter, Color = "1 1 1 1" }
}, "FAVORITE_WEAPON_STAT_PLAYER", "LABEL_KILL_AMOUNT");
}
container.Add(new CuiLabel
{
RectTransform = { AnchorMin = "1 0.5", AnchorMax = "1 0.5", OffsetMin = "-209.498 -63.3", OffsetMax = "-79.669 -49.2" },
Text = { Text = GetLang("STAT_UI_OTHER_STAT", player.UserIDString), Font = "robotocondensed-regular.ttf", FontSize = 11, Align = TextAnchor.MiddleLeft, Color = "1 1 1 1" }
}, UI_USER_STAT_INFO, "OTHER_STAT_LABEL");