Hello everyone, I can not track the destruction of the player's sleeping bag -
Used the following methods:
void OnEntityDeath(BaseCombatEntity entity, HitInfo info, BasePlayer player)
{
if (entity == null || player == null) return;
if (entity.ShortPrefabName != "sleepingbag_leather_deployed") return;
if (!DataBasePlayer.InfoData.ContainsKey(player.userID)) return;
DataBasePlayer.InfoData.Remove(player.userID);
SendReply(player,"Спальник сломан - хоум удален");
SaveData();
}
void OnEntityKill(BaseNetworkable entity, BasePlayer player)
{
if (entity == null || player == null) return;
if (entity.ShortPrefabName != "sleepingbag_leather_deployed") return;
if (!DataBasePlayer.InfoData.ContainsKey(player.userID)) return;
DataBasePlayer.InfoData.Remove(player.userID);
SendReply(player,"Спальник сломан - хоум удален");
SaveData();
}
void CanPickupEntity(BasePlayer player, BaseCombatEntity entity)
{
if (entity == null || player == null) return;
if (entity.ShortPrefabName != "sleepingbag_leather_deployed") return;
if (!DataBasePlayer.InfoData.ContainsKey(player.userID)) return;
DataBasePlayer.InfoData.Remove(player.userID);
SendReply(player,"Спальник сломан - хоум удален");
SaveData();
}None of the methods above work.