Beispiel #1
0
        public static void Process(Ped ped, int component, PedComponent slot, ClothSlotData slotData)
        {
            slotData.drawableCount = slot.Count;
            for (int dr = 0; dr < slotData.drawableCount; dr++)
            {
                if (slot.SetVariation(dr))
                {
                    var drData = new ClothDrawableData
                    {
                        textureCount = slot.TextureCount
                    };
                    slotData.drawables.Add(dr, drData);

                    for (int t = 0; t < slot.TextureCount; t++)
                    {
                        if (slot.SetVariation(dr, t))
                        {
                            drData.textures.Add(t, new ClothTextureData
                            {
                                id   = t,
                                hash = Function.Call <uint>(Hash.GET_HASH_NAME_FOR_COMPONENT, ped.Handle, component, dr, t)
                            });
                        }
                    }
                }
            }
        }
        public static void Process()
        {
            foreach (var pedH in peds)
            {
                Ped ped = World.CreatePed(pedH, Game.Player.Character.Position + Game.Player.Character.ForwardVector * 2.0f);

                if (ped != null)
                {
                    Script.Wait(100);
                    Style style = ped.Style;

                    var pedData = Main.Storage.AddPed(pedH, new PedData
                    {
                        hash = pedH
                    });

                    var components = style.GetAllComponents();
                    for (int i = 0; i < components.Length; i++)
                    {
                        var slotdata = new ClothSlotData();
                        pedData.slots.Add(i, slotdata);
                        PedStyleSlotProcessor.Process(ped, i, components[i], slotdata);
                    }

                    ped.Delete();
                }
            }
        }