Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using GTA;
- using GTA.Native;
- using System;
- using System.Windows.Forms;
- public class Burnout : Script
- {
- Ped player;
- Vehicle veh;
- ScriptSettings config;
- private Keys toggleKey;
- bool BurnoutOn = false;
- private bool OnBurnoutOf;
- float colorcode1;
- float colorcode2;
- float colorcode3;
- bool color = false; //redcolor description
- //bool greencolor = false; //greencolor description
- //bool bluecolor = false; //bluecolor description
- //bool yellowcolor = false; //yellowcolor description
- //bool blackcolor = false; //color description
- //bool lightbluecolor = false; //color description
- public Burnout()
- {
- Tick += OnTick;
- KeyDown += OnKeyDown;
- UI.Notify("~g~Loaded Burnout");
- /// UI.Notify("~b~Please click the activate button 3 times to activate the mod. ~b~When you did that you can enable/Disable the mod by pressing the same button once");
- config = ScriptSettings.Load("scripts\\Burnout.ini");
- toggleKey = config.GetValue<Keys>("Options", "toggleKey", Keys.L); ///This is the deault key that will be used, Unless changed in the Burnout.ini file.
- color = config.GetValue<bool>("Options", "colorenable", false); ///This is the red color type.
- colorcode1 = config.GetValue<float>("Colorcode", "Colorcode1", 255); ///This is color code 1, default it's set to red.
- colorcode2 = config.GetValue<float>("Colorcode", "Colorcode2", 0); ///This is color code 2, default it's set to none.
- colorcode3 = config.GetValue <float>("Colorcode", "Colorcode3", 0); ///This is color code 3, default it's set to none.
- //greencolor = config.GetValue<bool>("Options", "GreencolorConfig", false); ///This is the green color type.
- //bluecolor = config.GetValue<bool>("Options", "bluecolorConfig", false); ///This is the blue color type.
- //yellowcolor = config.GetValue<bool>("Options", "yellowConfig", false); ///This is the yellow color type.
- //blackcolor = config.GetValue<bool>("Options", "blackcolorConfig", false); ///This is the black color type.
- //lightbluecolor = config.GetValue<bool>("Options", "lightbluecolorConfig", false); ///This is the color type.
- }
- void OnKeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == toggleKey)
- {
- OnBurnoutOf = !OnBurnoutOf;
- Function.Call(Hash.SET_VEHICLE_BURNOUT, veh, OnBurnoutOf ? 1 : 0);
- player = Game.Player.Character;
- if (player.IsInVehicle())
- {
- veh = player.CurrentVehicle;
- {
- BurnoutOn = !BurnoutOn;
- }
- }
- if (!veh.IsDriveable)
- {
- BurnoutOn = false;
- }
- }
- if (!player.IsInVehicle())
- {
- BurnoutOn = false;
- }
- }
- private void OnTick(object sender, EventArgs e)
- {
- float size = 0.8f; ///If you change this you can change the size of the smoke. #Default = 0.5
- if (BurnoutOn == true)
- {
- if (Function.Call<bool>(Hash.HAS_NAMED_PTFX_ASSET_LOADED, "scr_carsteal4"))
- {
- Function.Call(Hash._SET_PTFX_ASSET_NEXT_CALL, "scr_carsteal4");
- Function.Call<int>(Hash.START_PARTICLE_FX_NON_LOOPED_ON_ENTITY, "scr_carsteal4_wheel_burnout", veh, -0.5f, -1.8f, 0.2f, -0, -0, -0, size, 0, 1, 0);
- if (color == true)
- {
- //Function.Call(Hash.SET_PARTICLE_FX_NON_LOOPED_COLOUR, 255f, 0f, 0f); //This will change the smoke color to red.
- Function.Call(Hash.SET_PARTICLE_FX_NON_LOOPED_COLOUR, colorcode1, colorcode2, colorcode3); //This will change the smoke color to red.
- //greencolor = false;
- //bluecolor = false;
- //yellowcolor = false;
- //blackcolor = false;
- //lightbluecolor = false;
- }
- //if (bluecolor == true)
- //{
- // Function.Call(Hash.SET_PARTICLE_FX_NON_LOOPED_COLOUR, 0f, 0f, 255f); //This will change the smoke color to green.
- // redcolor = false;
- // greencolor = false;
- // yellowcolor = false;
- // blackcolor = false;
- // lightbluecolor = false;
- //}
- //if (greencolor == true)
- //{
- // Function.Call(Hash.SET_PARTICLE_FX_NON_LOOPED_COLOUR, 0f, 255f, 0f); //This will change the smoke color to blue.
- // redcolor = false;
- // bluecolor = false;
- // yellowcolor = false;
- // blackcolor = false;
- // lightbluecolor = false;
- //}
- //if (yellowcolor == true)
- //{
- // Function.Call(Hash.SET_PARTICLE_FX_NON_LOOPED_COLOUR, 255f, 88f, 0f); //This will change the smoke color to yellow.
- // redcolor = false;
- // bluecolor = false;
- // greencolor = false;
- // blackcolor = false;
- // lightbluecolor = false;
- //}
- //if (blackcolor == true)
- //{
- // Function.Call(Hash.SET_PARTICLE_FX_NON_LOOPED_COLOUR, 0f, 0f, 0f); //This will change the smoke color to blue.
- // redcolor = false;
- // bluecolor = false;
- // greencolor = false;
- // yellowcolor = false;
- // lightbluecolor = false;
- //}
- //if (lightbluecolor == true)
- //{
- // Function.Call(Hash.SET_PARTICLE_FX_NON_LOOPED_COLOUR, 00f, 60f, 60f); //This will change the smoke color to blue.
- // redcolor = false;
- // bluecolor = false;
- // greencolor = false;
- // yellowcolor = false;
- // blackcolor = false;
- //}
- }
- else
- {
- Function.Call(Hash.REQUEST_NAMED_PTFX_ASSET, "scr_carsteal4");
- }
- if (Function.Call<bool>(Hash.HAS_NAMED_PTFX_ASSET_LOADED, "scr_carsteal4"))
- {
- Function.Call(Hash._SET_PTFX_ASSET_NEXT_CALL, "scr_carsteal4");
- }
- else
- {
- Function.Call(Hash.REQUEST_NAMED_PTFX_ASSET, "scr_carsteal4");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment