Quantcast

Jump to content

» «
Photo

Nitro mod

3 replies to this topic
shermi
  • shermi

    Player Hater

  • Members
  • Joined: 27 Feb 2012

#1

Posted 22 January 2014 - 12:54 PM

Hi..I need help writing a nitro mod...don't know were to begin...don't have a source code for the file..

Want to make that certain cars have Nos..or add Nos to a car by driving to a certain marker...Please help me.


stef538
  • stef538

    It's just me, going 88 MPH.

  • Members
  • Joined: 06 Oct 2012
  • Netherlands

#2

Posted 22 January 2014 - 04:26 PM

hmm, i don't have much time but you can try this for the nitro, for FX i would try JULIO NIB's PTFX tutorial

 

player.character.currentvehicle.speed =+ 0.2 or something like this.


shermi
  • shermi

    Player Hater

  • Members
  • Joined: 27 Feb 2012

#3

Posted 22 January 2014 - 06:39 PM Edited by shermi, 22 January 2014 - 06:40 PM.

Thanx Stef538..Will try it.


LordOfTheBongs
  • LordOfTheBongs

    Deceased

  • Members
  • Joined: 21 Sep 2013
  • None

#4

Posted 24 January 2014 - 10:44 PM Edited by LordOfTheBongs, 24 January 2014 - 10:48 PM.

two ways u can do it, probably a few more ways u can do it... one way if u hold key it will continuously add speed, i called it "Rocket Mode" (this is what stef538 is describing above) and the other way it simulates a shot of nitrous that would just provide a boost in speed... it all depends how u want to do it

namespace Nitrous
{
    using System;
    using System.Windows.Forms;
    using GTA;
    using GTA.Native;
 
    public class Nitrous : Script
    {
        private bool toggleMode;
 
        public Nitrous()
        {
            BindKey(Keys.F1, ToggleMode);
            KeyDown += Nitrous_KeyDown;
        }
 
        private void Text(string text, int duration = 5000)
        {
            Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", text, duration, 1);
        }
        private void ToggleMode()
        {
            toggleMode = !toggleMode;
            
            if (toggleMode)
            {
                Text("Rocket Mode");
                KeyDown -= Nitrous_KeyDown;
                Tick += Nitrous_Tick;
            }
            else
            {
                Text("Boost Mode");
                Tick -= Nitrous_Tick;
                KeyDown += Nitrous_KeyDown;
            }
        }
 
        private void Nitrous_KeyDown(object sender, GTA.KeyEventArgs e)
        {
            if (Game.LocalPlayer.Character.isInVehicle()&& Game.LocalPlayer.Character.CurrentVehicle.isDriveable)
            {
                if (e.Key == Keys.X)
                {
                    Game.LocalPlayer.Character.CurrentVehicle.ApplyForceRelative(new Vector3(0f, 4f, -0.4f));
                }
            }
        }
 
        private void Nitrous_Tick(object sender, EventArgs e)
        {
            if (Game.LocalPlayer.Character.isInVehicle()&& Game.LocalPlayer.Character.CurrentVehicle.isDriveable)
            {
                if (Game.isKeyPressed(Keys.X))
                {
                    Game.LocalPlayer.Character.CurrentVehicle.Speed += 0.4f;
                }
            }
        }
    }
}




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users