Exemplo n.º 1
0
        public static void CreateItemCmd(string item)
        {
            var owner = ConsoleSystem.Caller.Pawn;

            if (owner == null)
            {
                return;
            }

            BaseItem itemClass = ItemUtils.GetItemById(item);

            // Check to make sure we've actually returned an item.
            if (itemClass == null)
            {
                Log.Info($"Error: {item} could not be found.");
                return;
            }

            Log.Info($"{itemClass}");

            Vector3 pos = Vector3.Zero;
            Angles  ang = new Angles(0, owner.EyeRot.Angles().yaw, 0);

            var tr = Trace.Ray(owner.EyePos, owner.EyePos + owner.EyeRot.Forward * 200)
                     .UseHitboxes()
                     .Ignore(owner)
                     .Size(2)
                     .Run();

            pos = tr.EndPos;

            CreatePhysicalItem(itemClass, pos, ang);
        }