Ejemplo n.º 1
0
 private static bool GameMessage(ClientInfo _cInfo, EnumGameMessages _type, string _msg, string _mainName, bool _localizeMain, string _secondaryName, bool _localizeSecondary)
 {
     try
     {
         if (_cInfo != null && _type == EnumGameMessages.EntityWasKilled)
         {
             EntityPlayer player = PersistentOperations.GetEntityPlayer(_cInfo.entityId);
             if (player != null)
             {
                 if (KillNotice.IsEnabled && (KillNotice.Zombie_Kills || KillNotice.Animal_Kills) && string.IsNullOrEmpty(_secondaryName))
                 {
                     if (KillNotice.Damage.ContainsKey(player.entityId))
                     {
                         KillNotice.Damage.TryGetValue(player.entityId, out int[] damage);
                         EntityZombie zombie = PersistentOperations.GetZombie(damage[0]);
                         if (zombie != null)
                         {
                             KillNotice.ZombieKilledPlayer(zombie, player, _cInfo, damage[1]);
                         }
                         else
                         {
                             EntityAnimal animal = PersistentOperations.GetAnimal(damage[0]);
                             if (animal != null)
                             {
                                 KillNotice.AnimalKilledPlayer(animal, player, _cInfo, damage[1]);
                             }
                         }
                     }
                 }
             }
         }
     }
     catch (Exception e)
     {
         Log.Out(string.Format("[SERVERTOOLS] Error in API.GameMessage: {0}", e.Message));
     }
     return(true);
 }