[WIP] Drift smoke [v1.5]

Info

  • Burnout smoke
  • You can edit the size of the smoke
  • You can edit the density of the smoke
  • You can edit toggle key

Changelog

[UNRELEASED][??-??-????]
- Sync the smoke of other players

[RELEASED][1.5][08-02-2018][7PM]
- Burnout smoke
- Toggle key (default: LEFT CTRL)
- Angle check 

[RELEASED][1.0][08-02-2018][3AM]
- Initial Release

Download


Screenshot

Credits:
@Bluethefurry - angle function

10 Likes

The only problem is when you are driving anywhere you tires smoke even when your not doing a burnout

1 Like

same as above, might be worth adding a event key, so you can turn it on and off as u like, but other then that its a great start.

3 Likes

Cool concept! I do believe there is a native to check if a vehicle is doing a burnout.

1 Like

Maybe if pressing key W and S?

Or maybe look at what blu does for his drifting points resource

3 Likes

Version 1.5

  • Burnout smoke
  • Toggle key (default: LEFT CTRL)
  • Angle check
2 Likes

Mate this perfect, cant wait for future updates

Veeeerrrrry nice indeed! Thanks for this!

Really nice! Added it now to my server, works like a charm! :slight_smile:

Great script, actualy i have an idea, there is sexyspeedometer that has skin wich detects if you are drifting, if it was possible to tie those two together, it would be awosome

i have a great idea. you should add a custom rgb script in there so we can change the colour of the smoke

2 Likes

Great idea
I can’t do that, because I can not edit rgb to that particle FX.

try this out

/*

  • Rainbow Tire Smoke
  • Author: libertylocked
  • Version: 0.1
    */
    using System;
    using System.Drawing;
    using System.Windows.Forms;
    using GTA;
    using GTA.Native;

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())
        {
            // Increment hue
            huePercent += 1 * mult;
            if (huePercent >= 99 || huePercent <= 0) mult *= -1;

            SetTireSmokeColor(player.Character.CurrentVehicle, HSL2RGB((double)huePercent / 100, 0.5, 0.5));
        }
    }

    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 v;
        double r, g, b;

        r = l;   // default to gray
        g = l;
        b = l;
        v = (l <= 0.5) ? (l * (1.0 + sl)) : (l + sl - l * sl);
        if (v > 0)
        {
            double m;
            double sv;
            int sextant;
            double fract, vsf, mid1, mid2;

            m = l + l - v;
            sv = (v - m) / v;
            h *= 6.0;
            sextant = (int)h;
            fract = h - sextant;
            vsf = v * sv * fract;
            mid1 = m + vsf;
            mid2 = v - vsf;
            switch (sextant)
            {
                case 0:
                    r = v;
                    g = mid1;
                    b = m;
                    break;
                case 1:
                    r = mid2;
                    g = v;
                    b = m;
                    break;
                case 2:
                    r = m;
                    g = v;
                    b = mid1;
                    break;
                case 3:
                    r = m;
                    g = mid2;
                    b = v;
                    break;
                case 4:
                    r = mid1;
                    g = m;
                    b = v;
                    break;
                case 5:
                    r = v;
                    g = m;
                    b = mid2;
                    break;
            }
        }
        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);
    }
}

}

1 Like

this is awsome!!! i already love it but can i suggest adding a config if possible for the duration of the smoke so it dosnt dissapear so quick. milliseconds or seconds would be sweet!!! Thanks again for release.

2 Likes

I attempted to config the smoke to make it larger and the script then failed to show any smoke at all beside the default smoke. Also +1 to @GeorgeRios idea. Allow the smoke to stay for a while :slight_smile:

Hi i play in a server Roleplay in FiveM, i see they have on the server your script but they change the bind key, how to see wich key i need to press? I can press F8 and type something telling me the changed key? Ill’ wait an answer thanks!

How to make the color look like it but chooses inside vMenu

Is there some workaround for OneSync? It doesn’t work with it yet :frowning:

1 Like

I added the multiple car drift smoke support for this plugin: