public void SpawnPet(UnturnedPlayer player, PlayerPet pet)
        {
            foreach (var activePet in GetPlayerActivePets(player.Id).ToArray())
            {
                KillPet(activePet);
            }

            pet.Animal = AnimalsHelper.SpawnAnimal(pet.AnimalId, player.Position, (byte)player.Rotation);
            pet.Player = player.Player;
            ActivePets.Add(pet);
            OnPetSpawned.TryInvoke(pet);
        }
Ejemplo n.º 2
0
 private void SendDeadPet(PlayerPet pet)
 {
     AnimalsHelper.KillAnimal(pet.Animal);
 }
 public void KillPet(PlayerPet pet)
 {
     AnimalsHelper.KillAnimal(pet.Animal);
     ActivePets.Remove(pet);
     OnPetDespawned.TryInvoke(pet);
 }