About This File
This resource provides 3 serverside functions to work with tire smoke color feature of GTA V.
Installing
- Put the files you downloaded in their respective places
- Add require('tiresmoke') to client_packages/index.js
- All done
Serverside API
/** * Sets the tire smoke color of a vehicle. * @param {Number} red * @param {Number} green * @param {Number} blue */ vehicle.setTyreSmokeColor(red, green, blue); /** * Gets the tire smoke color of a vehicle. * @return {Object} Tire smoke color, will be null if the vehicle doesn't have one set. */ vehicle.getTyreSmokeColor(); /** * Resets the tire smoke color of a vehicle. */ vehicle.resetTyreSmokeColor();
Example Code
// Example: /setsmokecol 255 0 0 mp.events.addCommand("setsmokecol", (player, _, r, g, b) => { if (!player.vehicle) { player.outputChatBox("not in vehicle"); return; } player.vehicle.setTyreSmokeColor(Number(r), Number(g), Number(b)); player.outputChatBox("smoke color set"); }); // Output: "smoke color: {"r":255,"g":0,"b":0}" or "smoke color: null" if you haven't used setsmokecol before mp.events.addCommand("getsmokecol", (player) => { if (!player.vehicle) { player.outputChatBox("not in vehicle"); return; } player.outputChatBox(`smoke color: ${JSON.stringify(player.vehicle.getTyreSmokeColor())}`); }); mp.events.addCommand("remsmokecol", (player) => { if (!player.vehicle) { player.outputChatBox("not in vehicle"); return; } player.vehicle.resetTyreSmokeColor(); player.outputChatBox("smoke color reset"); });
Notes
- Since this script toggles the tire smoke mod (toggleMod 20), it may not work with your car customization script.
- Setting the tire smoke color of a vehicle, then changing its model will cause visual desync. Apply tire smoke color again/reset it after changing a vehicle's model to not have this issue.
- Even though NativeDB says setting the RGB to 0, 0, 0 applies independence day tire smoke, all it did for me was make the tire smoke invisible.
- Future versions of RAGEMP might add tire smoke color sync, if it happens you should stop using this resource.
Source code is available on GitHub in case you don't want to download: https://github.com/root-cause/ragemp-tire-smoke