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)
                            });
                        }
                    }
                }
            }
        }
 /// <summary>
 /// Gives peds specific components
 /// </summary>
 /// <param name="comp">IS ZERO BASED INDEX (SNT is 1 based)</param>
 /// <param name="drawIndex">IS ZERO BASED INDEX (SNT is 1 based)</param>
 /// <param name="variation">IS ZERO BASED INDEX (SNT is 1 based)</param>
 public static void GivePedVariation(this Ped ped, PedComponent comp, int drawIndex, int variation = 0) => ped.SetVariation((int)comp, drawIndex, variation);