kovacs22 Posted September 3, 2017 Share Posted September 3, 2017 (edited) I took this script out of another rainbow tire color mod, but I modified it. I basically just left the terms and other variables the way they were and edited out the essentials to create a solid color. I can't exactly run it right now until the latest Script Hook V gets released, but I'm wondering for you programmers, will this code set a solid RGB color? If I can edit out non-essentials and simplify the coding below, then please let me know what I can change it to. Thanks in advance! namespace RainbowTireSmoke { public class RainbowTireSmoke : Script { // You can change the tick interval if you want to adjust transition speed const int TICK_INTERVAL = 100; int huePercent = 0; int mult = 1; public RainbowTireSmoke() { this.Interval = TICK_INTERVAL; this.Tick += OnTick; } void OnTick(object sender, EventArgs e) { Player player = Game.Player; if (player != null && player.CanControlCharacter && player.IsAlive && player.Character != null && player.Character.IsInVehicle()) { SetTireSmokeColor(player.Character.CurrentVehicle, HSL2RGB((double)huePercent / 210, 0.5, 0.35)); } } void SetTireSmokeColor(Vehicle vehicle, Color color) { // void _SET_VEHICLE_NEON_LIGHTS_COLOUR(Vehicle vehicleHandle, int r, int g, int b) // 0x8E0A582209A62695 Function.Call(Hash.SET_VEHICLE_TYRE_SMOKE_COLOR, vehicle, color.R, color.G, color.B); } // Given H,S,L in range of 0-1 // Returns a Color (RGB struct) in range of 0-255 public static Color HSL2RGB(double h, double sl, double l) { double r, g, b; r = 45; // set RGB color to Dark Slate (Blue-Gray) g = 89; b = l34; int colorR = Math.Min(Convert.ToInt32(r * 255.0f), 255); int colorG = Math.Min(Convert.ToInt32(g * 255.0f), 255); int colorB = Math.Min(Convert.ToInt32(b * 255.0f), 255); return Color.FromArgb(colorR, colorG, colorB); } } } Edited September 3, 2017 by kovacs22 Link to comment Share on other sites More sharing options...