GTA/Grand Theft Auto FPS Auto Sprint

I give credit to bonefisher for helping me with this script. This script is for Auto Sprint in First/Third Person view with control settings on FPS (type) settings. This version has a single-click activate/deactivate Auto Sprint. With this script, you will be able to sprint by just pushing the left analog stick in the direction you wish to go. While in a full sprint you can aim, fire and/or reload your weapon while in full sprint. With the FPS setting, you can bring up and select snacks or armor via TOUCH/P4 menu and restore your health or put on armor while sprinting, swimming, and shooting to name a few. This script was written for FPS control settings only. So this script will not work on FPS 2 or non-FPS control settings
Version2.00
AuthorJ.Guza
Publish DateSat, 30 Jul 2016 - 03:31
Last UpdateSat, 30 Jul 2016 - 03:31
Downloads204
RATE


0

0

Release Notes: After further use of this script, I found out a couple of things. Sometimes it does require you to double-click R1/RB/(3) when you dive from the waters surface to maintain your swimming speed. With the landing gear option [4], it's best to avoid using the RIGHT/(16) in the activate/deactivate or to raise/lower the landing gear because the Hydra requires you to press RIGHT/(16) to switch flight modes.
Code: Select all
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@[ INSTRUCTIONS ]@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 
//When I mention script, I mean the entire GPC script. When I mention "feature(s)".                                                                                     
//I mean a small part of the GPC script that carries out a specific duty, like the   
//ones I listed just below, with a number assigned to each one. They're basically                           
//like little scripts within the GPC script that carry out that task. I will   
//highlight "features" with quotation marks so you know what I'm refering to.
 
//                                   TAGGING
//   //*  By tag/tagged/tagging, I simply mean disabled and noted as such with //*
//        usually located to the far left of the page before the "features" lines.
//        I use these "tags" in this script to disable "features" or lines that I
//        have alternative ways in place to be used, should you choose to use
//        them. If you choose to use the alternate way, you would then tag the 
//        line(s) of the part you no longer wish to use and then simply take off 
//        the tag(s) on the line(s) you wish to use. Lines that have been tagged, 
//        don't take up any byte space. If you know you won't use the feature
//        ever, thne get rid of it, it you like, but you should check to see if
//        if I have an alternate way fist, that might work better for you.
 
//  [1]-  These numbers on the right side of the script are assigned to a
//  [16]  particular "feature". If you tag these "features" or lines or remove   
//        tags from these lines, you will then know what "feature" they apply to.     
//        I gave a description of each "feature" and the numbers I assigned to 
//        them, just below. You may notice skipped numbers for "features"
//        throughout the script. This is because when I wrote up my script, I had
//        put all the "features" on one page and labeled them. I have these 
//        missing "features" in the GPC library as well under different titles.
 
//@@@@@@@@@@@@@@@@@@@@@@@@@@[ FEATURES DESCRIPTIONS ]@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 
//-----------------------------[ SPRINT FEATURES ]---------------------------------
 
//Included are SINGLE & DOUBLE TAP R1/RB/3 and HAIR TRIGGERS.                       1
//These "features" are only running when Auto Sprint is activated and done so       1
//purposely. The SINGLE & DOUBLE TAP R1/RB/3 doesn't do anything outside of Auto    1
//Sprint, but the HAIR TRIGGERS do affect dirving.                                  1
//______________                                                                    1
//-[AUTO SPRINT]                              [AUTO SPRINT'S Activate/Deactivate]   1
//**************                                                                    1
//Activated/deactivated by one-click L3/LS(8). Once activated, you sprint in any    1   
//direction you want by pushing the left analog stick in the direction you want to  1   
//go. Works for fast swimming as well. In this "feature", I've included rumble      1     
//notifiers and LED's to distinguish when you activate & when you deactivate the    1
//"feature". Within this "feature" are two other "features" that work best along    1       
//with Auto Sprint and have very little use otherwise. Auto Sprint is meant to be   1   
//activated while on foot and deactivated while in a vehicle. If you don't          1
//deactivate it when you get into a vehicle or aircraft, horns will sound off and   1     
//landing gear will go up & down at random times. The Hair Triggers make it harder  1 
//to control the cars acceleration and braking. With Auto Sprint on, you may find   1       
//it difficult to navigate around objects, tight corners or get up stairs because   1                                   
//of the speed. You can either deactivate Auto Sprint or just aim your weapon and   1           
//point in the direction you want to go in these cases and advance with no problem. 1   
//Below I have 2 aternative ways listed along with the currently used line, which   1
//is the first one listed. Should you want to lessen the sensitivity of the 360     1
//degrees always on (when activated) Auto Sprint, you can try either of these.      1     
//You'll want to keep the + numbers + and - numbers -. You can only make the        1                                                                     
//numbers (1-100). Try them out and see what works best for you. Having higher      1
//numbers will allow you to tilt the left analog stick off center more before Auto  1   
//Sprint engages. Be aware that having higher numbers will likely affect swimming   1
//in a negative way.                                                                1                         
//                                                                                  1
//if (get_val(12) <= 100)  //<- CURRENTLY USED LINE.                                1
//*if (get_val(12) < -5 || abs(get_val(11)) > 5 ^^ abs(get_val(11)) < -5 ) {        1                                     
//*if (abs(get_val(12)) > 5 || abs(get_val(11)) > 5) {                              1
//                                                                                  1
//To reload while sprinting, you need to double-tap CIRCLE/B/(18). If standing      1
//still, you only need to press once to reload. I would suggest you to take the     1
//reload option out of the Auto Sprint "feature", if you can do without it.         1
//Leaving it in will allow you to double-tap CIRCLE/B/(18) to reload while          1 
//sprinting. However, it comes at the expense of slowing you down while sprinting   1     
//or when backing out of the snack/armor menu. Reload is slow anyways. I'd suggest  1
//you just switch weapons, which is faster than reloading. For example, I often     1
//switch in between the MG & Special Carbine Rifle. The line below, which is in     1
//the script, is the one you would remove. Located in 1st section of AUTO SPRINT.   1
//                                                                                  1
// if (get_val(7) || get_val(4) || get_val(18)) {  // *|| get_val(18)"(reload).     1
//______________________________
//-[SINGLE & DOUBLE TAP R1/RB/3]              [AUTO SPRINT'S Activate/Deactivate]   2
//******************************                                                    2
//____________________                                                              2
//Single Tap R1/RB/(3) is for when you press R1/RB/(3) once to take cover. It's     2
//used for when using Auto Sprint, to allow you time getting yourself into position 2
//after pressing R1/RB/(3) to take cover. This "feature" is required to take cover  2
//while using Auto Sprint or you will not be able to take cover with Auto Sprint    2
//activated. You can adjust this time in DEFINES and/or the TakeCover combo. I      2
//currently have the TakeCover time set at 6 seconds. Once the 6 seconds are up,    2
//if you move your feet via the L3/LS(8) analog, you will break/leave cover.        2
//____________________                                                              2
//DOUBLE TAP R1/RB/(3) is used to cancel/void the TakeCoverTime which temporaily    2
//stops Auto Sprint. You double tap R1/RB/(3) to allow you to immediately sprint    2     
//if you're still within the set TakeCover period of time. Otherwise you can just   2
//sprint, without the Single or Double Tap feature. I use DOUBLE TAP R1/RB/(3)when  2                                       
//I get in cover via Single Tap R1/RB/(3) and then need to leave very shortly       2
//afterwards & don't want to wait for the TakeCoverTime to expire before I sprint.  2             
//                                                                                  2
//Of special note. I didn't realise this at first because I'm fairly new to using   2
//the FPS control setting. You don't press R1/RB/(3) while using the FPS setting    2
//to dive under water when swimming, you just press forward on the L3/LS/(8).       2
//________________
//-[HAIR TRIGGERS]                            [AUTO SPRINT'S Activate/Deactivate]   3
//****************                                                                  3
//This "feature" allows the fastest response times on aiming & firing your weapon.  3 
//                                                                                  3
//&&&&&&&&&&&&&&&&&&&&&&&&&&[ INDEPENDANT FEATURES ]&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
//_________________________________                                                 4
//-[LANDING GEAR/SIRENS/KERS BOOST]                         [Activate/Deactivate]   4
//*********************************                                                 4
//This Version has LED and rumble notifiers. Since the default is [5] you would     4         
//have to tag [5] and untag [4]. To activate/deactivate you simply press RIGHT/(16) 4
//and CROSS/A/(19). Then press D-Pad LEFT to use. This "feature" is used to raise/  4
//lower landing gear, for sirens and the Lectro motorcyle using KERS boost. I use   4
//this "feature" primarily for the landing gear. When you jump into an aircraft     4
//with landing gear, you want to make sure the Auto Sprint is deactivated, that [4] 4           
//is activated and then press D-Pad LEFT to raise or lower the landing gear. You    4
//can use the D-Pad LEFT to shut off sirens as well as for KERS Boost as I          4
//mentioned. The reason why you have to use D-Pad LEFT is, the normal way of        4         
//pressing L3/LS/8) will not only not work, it will activate Auto Sprint.           4
//_________________________________
//-[LANDING GEAR/SIRENS/KERS BOOST]                                   [Always On]   5
//*********************************                                                 5
//The advantage of this default version is that you don't have to mess with an      5
//activate/deactivate. The disadvatage is, when left always on and you bring up     5
//your phone or TOUCH/P4/(27) menu, the horn sounds when you use the D-Pad LEFT.    5
//________________
//-[TURBO CROSS/A]                                                    [Always On]   7
//****************                                                                  7
//Can be used to Auto Sprint with Standard conrol settings, but not for FPS or      7
//FPS2 controller settings. I still use this with FPS settings as a quick way to    7
//to buy ammunition, snacks, armor, and more. Do so by just holding down on         7
//CROSS/A/(19).                                                                     7
//_____________                                             
//-[TURBO JUMP]                                                       [Always On]   8
//*************                                                                     8
//By holding down on SQUARE/X/(20), it allows you to jump repeatedly without        8
//doing repetitive button presses. I find this useful when wearing armored          8
//outfits, as it's the fastest way to move while wearing armored outfits. Turbo     8
//Jump also works great when jumping inside of buildings, in tunnels, up steep      8
//inclines and on land in certain areas that normally are bogged down. In those     8
//cases Turbo Jump would be faster than trying to sprint. I've done a number of     8
//tests in said situations and found that having Auto Sprint on/off while Turbo     8
//Jumping, made no difference in the times posted. So Turbo Sprint does not slow    8
//you down or speed you up when using with Turbo Jump.                              8
 
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@[ DEFINES ]@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 
//DEFINE (0) | PS4_PS | PS3_PS | XB1_XBOX | XB360_XBOX                 
//DEFINE (1) | PS4_SHARE | PS3_SELECT | XB1_VIEW | XB360_BACK                     [AUTO SPRINT] ...1.... [AUTO SPRINT'S Activate/Deactivate]
//DEFINE (2) | PS4_OPTIONS | PS3_START | XB1_MENU | XB360_STAR  [SINGLE & DOUBLE TAP R1/RB/(3)] ...2.... [AUTO SPRINT'S Activate/Deactivate]
//DEFINE (3) | PS4_R1 | PS3_R1 | XB1_RB | XB360_RB                              [HAIR TRIGGERS] ...3.... [AUTO SPRINT'S Activate/Deactivate]
//DEFINE (4) | PS4_R2 | PS3_R2 | XB1_RT | XB360_RT             [LANDING GEAR/SIRENS/KERS BOOST] ...4.... [Activate/Deactivate]
//DEFINE (5) | PS4_R3 | PS3_R3 | XB1_RS | XB360_RS             [LANDING GEAR/SIRENS/KERS BOOST] ...5.... [Always On]                               
//DEFINE (6) | PS4_L1 | PS3_L1 | XB1_LB | XB360_LB                          [D-PAD SENSITIVITY] ...6.... [Always On]
//DEFINE (7) | PS4_L2 | PS3_L2 | XB1_LT | XB360_LT                              [TURBO CROSS/A] ...7.... [Always On]
//DEFINE (8) | PS4_L3 | PS3_L3 | XB1_LS | XB360_LS                                 [TURBO JUMP] ...8.... [Always On]
//DEFINE (9) | PS4_RX | PS3_RX | XB1_RX | XB360_RX                          [CLOSE APPLICATION] ...9.... [Activate Only]
//DEFINE (10)| PS4_RY | PS3_RY | XB1_RY | XB360_RY                [QUICK ONLINE PUBLIC SESSION] ...10... [Activate Only]             
//DEFINE (11)| PS4_LX | PS3_LX | XB1_LX | XB360_LX           [QUICK ONLINE INVITE ONLY SESSION] ...10+.. [Activate Only] 
//DEFINE (12)| PS4_LY | PS3_LY | XB1_LY | XB360_LY                 [THIRD VIEW AIM SENSITIVITY] ...11... [Activate Only] 
//DEFINE (13)| PS4_UP | PS3_UP | XB1_UP | XB360_UP                             [COMMIT SUICIDE] ...12... [Activate Only] 
//DEFINE (14)| PS4_DOWN | PS3_DOWN | XB1_DOWN | XB360_DOWN                             [SNACKS] ...13... [Activate Only] 
//DEFINE (15)| PS4_LEFT | PS3_LEFT | XB1_LEFT | XB360_LEFT                              [ARMOR] ...14... [Activate Only] 
//DEFINE (16)| PS4_RIGHT | PS3_RIGHT | XB1_RIGHT | XB360_RIGHT                   [PASSIVE MODE] ...15... [Activate Only] 
//DEFINE (17)| PS4_TRIANGLE | PS3_TRIANGLE | XB1_Y | XB360_Y                   [VEHICLE ACCESS] ...16... [Activate Only] 
//DEFINE (18)| PS4_CIRCLE | PS3_CIRCLE | XB1_B | XB360_B             
//DEFINE (19)| PS4_CROSS | PS3_CROSS | XB1_A | XB360_A               
//DEFINE (20)| PS4_SQUARE | PS3_SQUARE | XB1_X | XB360_X                                             
//DEFINE (27)| PS4_TOUCH | XB1_P4                                                                                       
 
   //Defines must go at the top of the page.                     
    define TakeCoverTime    = 4000//You can adjust for taking cover.        //2 
                                     //Here and in TakeCover combo.
 
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@[ INT's ]@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 
   //Int's must go below the defines, but above the init's.   
    int AutoSprintOnOff;                                                       //1 
    int Button_Timing;                                                         //2
    int Button_State             = 0;                                          //2
    int Double_Tap_Gap           = 200;     //Gap in between taps. Changeable. //2 
//*    int activateLandingGear      = FALSE;                                      //4
 
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@[ INIT's ]@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@   
 
   //Init's must go below the int's, but before the main{               
    init {AutoSprintOnOff = get_pvar(SPVAR_1, 1, 2, 1);                        //1         
    }                                                                          //1 
//---------------------------------------------------------------------------------
main{  //Main Start (Goes below init's and before the "features").
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@[ FEATURES ]@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 
   //AUTO SPRINT / RUMBLE NOTIFIERS / LED                                         
    if (event_release(8)) {                                                    //1                                                                             
    if (AutoSprintOnOff == 2) {                                                //1 
        AutoSprintOnOff = 1;                                                   //1 
        set_pvar(SPVAR_1, AutoSprintOnOff);                                    //1 
        combo_run(RumbleNotifier_2);                                           //1 
        set_led(LED_3, 0);                                                     //1 
    } else if (AutoSprintOnOff == 1) {                                         //1 
        AutoSprintOnOff = 2;                                                   //1
        set_pvar(SPVAR_1, AutoSprintOnOff);                                    //1
        combo_run(RumbleNotifier_1);                                           //1 
        set_led(LED_3, 1);                                                     //1 
        }                                                                      //1 
    }                                                                          //1 
    if (AutoSprintOnOff == 2) {                                                //1 
    if (get_val(12) <= 100){       //360 degrees Auto Sprint.                  //1 
        set_val(8, 100);                                                       //1               
    } else {                                                                   //1                                       
        set_val(8, 0);                                                         //1         
    }                              // *|| get_val(18)"(reload) option below.   //1         
    if (get_val(7) || get_val(4) || get_val(18)) {                             //1 
        set_val(8, 0);                                                         //1 
    }                                                                          //1 
   //SINGLE & DOUBLE TAP R1/RB/(3)-------------------------------------------------       
    if (event_press(3)) {          //Applies to SINGLE TAP.                    //2     
        combo_run(TakeCover);                                                  //2 
    }                                                                          //2   
    if (DoubleTap(3) == TRUE) {    //Applies to DOUBLE TAP.                    //2 
        combo_stop(TakeCover);                                                 //2 
    }                                                                          //2
   //HAIR TRIGGERS-----------------------------------------------------------------     
    if (get_val(7)) {                                                          //3 
        set_val(7, 100);                                                       //3
    }                                                                          //3   
    if (get_val(4)) {                                                          //3             
        set_val(4, 100);                                                       //3
    }                                                                          //3   
//---------------------------------------------------------------------------------     
}  //Ties the entire script together. Remains here regardless of what's tagged.//1                       
   //All the included "features" only run when AUTO SPRINT is activated.
//--------------------------------------------------------------------------------- 
 
   //LANDING GEAR / SIRENS / KERS BOOST                   
   //If you use this "feature", tag the below "feature" 5.   
//*    if (get_val(16) && event_press(19)){                                       //4                                             
//*        activateLandingGear  = !activateLandingGear;                           //4   
//*    if (activateLandingGear){                                                  //4 
//*            combo_run(RumbleNotifier_1);                                       //4   
//*            set_led(LED_2, 1);                                                 //4         
//*        } else {                                                               //4 
//*            combo_run(RumbleNotifier_2);                                       //4 
//*            reset_leds();                                                      //4 
//*        }                                                                      //4 
//*    }                                                                          //4                   
//*    if (activateLandingGear && get_val(15)) {                                  //4 
//*            set_val  (8, 100);                                                 //4
//*}                                                                              //4
   //LANDING GEAR / SIRENS / KERS BOOST--------------------------------------------                     
   //If you use this "feature", tag the above "feature" 4.
    if (get_val(15)) {                                                         //5     
        set_val(8, 100);                                                       //5 
}                                                                              //5
   //TURBO CROSS/A/----------------------------------------------------------------           
    if (get_val(19)) {                                                         //7 
    combo_run(TurboCrossA);                                                    //7 
}                                                                              //7 
   //TURBO JUMP--------------------------------------------------------------------
    if (get_val(20)) {                                                         //8
        combo_run(TurboJump);                                                  //8 
}                                                                              //8 
//---------------------------------------------------------------------------------   
}  //Main End (Goes after the featured scripts & before the combo's).
 
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@[ COMBO'S ]@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 
   //Combo's go after the Main End and before FUNCTIONS.
 
combo RumbleNotifier_1 {     //Notifies you when the "feature" is turned on.   //1/4         
    set_rumble(RUMBLE_B, 51);                                                  //1/4
    wait(300);                                                                 //1/4
    set_rumble(RUMBLE_B, 0);                                                   //1/4   
    wait(300);                                                                 //1/4   
    set_rumble(RUMBLE_B, 51);                                                  //1/4 
    wait(400);                                                                 //1/4   
    reset_rumble();                                                            //1/4
}                                                                              //1/4
combo RumbleNotifier_2 {     //Notifies you when the "feature" is shut off.    //1/4 
    set_rumble(RUMBLE_A, 51);                                                  //1/4 
    wait(300);                                                                 //1/4
    reset_rumble();                                                            //1/4
}                                                                              //1/4 
//---------------------------------------------------------------------------------   
combo TakeCover {            //Applies to the amount of time the TakeCover     //2                                           
    set_val  (8, 0);         //runs after pressing R1/RB/(3) to Take Cover.    //2
    wait(TakeCoverTime);     //You can choose to add to or subtract from the   //2
    set_val  (8, 0);         //TakeCoverTime if you wish. You can just put     //2
    wait(2000);              //in a specific # as well. I added 2 seconds on   //2
}                            //to TakeCover here. Also can change in DEFINES.  //2
//---------------------------------------------------------------------------------
combo TurboCrossA  {                                                           //7 
    set_val(19, 100);                                                          //7
    wait(100);                                                                 //7
    set_val(19, 0);                                                            //7
    wait(100);                                                                 //7
    set_val(19, 0);                                                            //7
}                                                                              //7
//---------------------------------------------------------------------------------
combo TurboJump  {                                                             //8       
    set_val(20, 100);                                                          //8     
    wait(100);                                                                 //8     
    set_val(20, 0);                                                            //8       
    wait(100);                                                                 //8       
    set_val(20, 0);                                                            //8
}                                                                              //8
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@[ FUNCTIONS ]@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 
   //Functions must be at the bottom of the script.                                           
   //SINGLE & DOUBLE TAP R1/RB/(3)
function DoubleTap(Button) {                                                   //2
    if(Button_State == 0) {                                                    //2
           if(get_val(Button)) Button_State = 1;                               //2 
    } else if(Button_State == 1) {                                             //2 
           if(!get_val(Button)) { Button_Timing = 0; Button_State = 2; }       //2 
    } else if(Button_State == 2) {                                             //2
           if(get_val(Button)) { Button_State = 1; return TRUE; }              //2 
              Button_Timing = Button_Timing + get_rtime();                     //2
           if(Button_Timing > Double_Tap_Gap) Button_State = 0;                //2
    }                                                                          //2
}                                                                              //2