Exemple #1
0
        internal static void Spawn(Player dst, Player p, byte id, ushort x, ushort y, ushort z,
                                   byte rotx, byte roty, string possession = "")
        {
            if (!Server.zombie.Running || !p.Game.Infected)
            {
                string col = p.color;
                if (col.Length >= 2 && !Colors.IsStandardColor(col[1]) && !dst.HasCpeExt(CpeExt.TextColors))
                {
                    col = "&" + Colors.GetFallback(col[1]);
                }
                string group = p.Game.Referee ? "&2Referees" : "&fPlayers";

                if (dst.hasExtList)
                {
                    dst.SendExtAddEntity2(id, p.skinName, col + p.truename + possession, x, y, z, rotx, roty);
                    dst.SendExtAddPlayerName(id, p.skinName, col + p.truename, group, 0);
                }
                else
                {
                    dst.SendSpawn(id, col + p.truename + possession, x, y, z, rotx, roty);
                }
                return;
            }

            string name = p.truename, skinName = p.skinName;

            if (ZombieGame.ZombieName != "" && !dst.Game.Aka)
            {
                name = ZombieGame.ZombieName; skinName = name;
            }

            if (dst.hasExtList)
            {
                dst.SendExtAddEntity2(id, skinName, Colors.red + name + possession, x, y, z, rotx, roty);
                dst.SendExtAddPlayerName(id, skinName, Colors.red + name, "&cZombies", 0);
            }
            else
            {
                dst.SendSpawn(id, Colors.red + name + possession, x, y, z, rotx, roty);
            }

            if (dst.hasChangeModel && id != 0xFF)
            {
                dst.SendChangeModel(id, ZombieGame.ZombieModel);
            }
        }
Exemple #2
0
        internal static void Spawn(Player dst, Player p, byte id, ushort x, ushort y, ushort z,
                                   byte rotx, byte roty, string possession = "")
        {
            if (!Server.TablistGlobal)
            {
                TabList.Add(dst, p, id);
            }
            if (!Server.zombie.Running || !p.Game.Infected)
            {
                string col = GetSupportedCol(dst, p.color);
                if (dst.hasExtList)
                {
                    dst.SendExtAddEntity2(id, p.skinName, col + p.truename + possession, x, y, z, rotx, roty);
                }
                else
                {
                    dst.SendSpawn(id, col + p.truename + possession, x, y, z, rotx, roty);
                }
                return;
            }

            string name = p.truename, skinName = p.skinName;

            if (ZombieGameProps.ZombieName != "" && !dst.Game.Aka)
            {
                name = ZombieGameProps.ZombieName; skinName = name;
            }

            if (dst.hasExtList)
            {
                dst.SendExtAddEntity2(id, skinName, Colors.red + name + possession, x, y, z, rotx, roty);
            }
            else
            {
                dst.SendSpawn(id, Colors.red + name + possession, x, y, z, rotx, roty);
            }

            if (dst.hasChangeModel && id != Entities.SelfID)
            {
                dst.SendChangeModel(id, ZombieGameProps.ZombieModel);
            }
        }
Exemple #3
0
 internal static void Spawn(Player dst, PlayerBot b)
 {
     if (dst.hasExtList)
     {
         dst.SendExtAddEntity2(b.id, b.skinName, b.color + b.name, b.pos[0], b.pos[1], b.pos[2], b.rot[0], b.rot[1]);
         dst.SendExtAddPlayerName(b.id, b.skinName, b.color + b.name, "Bots", 0);
     }
     else
     {
         dst.SendSpawn(b.id, b.color + b.skinName, b.pos[0], b.pos[1], b.pos[2], b.rot[0], b.rot[1]);
     }
 }
Exemple #4
0
        internal static void Spawn(Player dst, PlayerBot b)
        {
            string name = Chat.Format(b.color + b.DisplayName, dst, true, true, false);

            if (b.DisplayName.CaselessEq("empty"))
            {
                name = "";
            }
            string skin = Chat.Format(b.SkinName, dst, true, true, false);

            if (dst.hasExtList)
            {
                dst.SendExtAddEntity2(b.id, skin, name, b.pos[0], b.pos[1], b.pos[2], b.rot[0], b.rot[1]);
            }
            else
            {
                dst.SendSpawn(b.id, name, b.pos[0], b.pos[1], b.pos[2], b.rot[0], b.rot[1]);
            }
            if (Server.TablistBots)
            {
                TabList.Add(dst, b);
            }
        }