Example #1
0
        public static void Spawn(Player dst, Player p, Position pos,
                                 Orientation rot, string possession = "")
        {
            byte   id = p == dst ? Entities.SelfID : p.id;
            string name = p.color + p.truename + possession;
            string skin = p.SkinName, model = p.Model;

            OnEntitySpawnedEvent.Call(p, ref name, ref skin, ref model, dst);

            SpawnRaw(dst, id, p, pos, rot, skin, name, model);
            if (!Server.Config.TablistGlobal)
            {
                TabList.Add(dst, p, id);
            }
        }
Example #2
0
        internal static void Spawn(Player dst, PlayerBot b)
        {
            string name = Chat.Format(b.color + b.DisplayName, dst, true, false);

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

            OnEntitySpawnedEvent.Call(b, ref name, ref skin, ref model, dst);
            SpawnRaw(dst, b.id, b, b.Pos, b.Rot, skin, name, model);
            if (Server.Config.TablistBots)
            {
                TabList.Add(dst, b);
            }
        }
Example #3
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);
            }
        }
Example #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);
            }
        }