Sensitivity Fine-Tuning w/ Anti Recoil

I use this script a lot, fairly helpful.
Version1
AuthorValant
Publish DateFri, 15 Jul 2016 - 19:48
Last UpdateFri, 15 Jul 2016 - 19:48
Downloads775
RATE


0

1

Code: Select all
// GPC Online Library
// multiplatform_complete_antirecoil.gpc
 
/* * 
    GENERIC ANTI-RECOIL VERTICAL + HORIZONTAL (LEFT + RIGHT)
    Version:     2.0
    Author:      LEX LOST
    Republisher: Valant
    Platform:    MULTI
    Controller:  MULTI - Optimized for MOUSE & KEYBOARD
    GAME:        All FPS titles
 
    ************************************************************/

 
    define ONLY_WITH_SCOPE = TRUE;// if TRUE Antirecoil only when scoping
    define ANTI_RECOIL = 0;       // change this value to compensate vertical recoil (0 - 100)
    define ANTI_RECOIL_LEFT = 0// change this value to compensate to the left (0 - 100)
    define ANTI_RECOIL_RIGHT = 0; // change this value to compensate to the right (0 - 100)
    define ADS_BUTTON = 7; // 7 = LT/L2 - change for different layout; write 6 instead of 7 if you aim with LB/L1
 
    define ADS_SENS = 100; // Sensitivity while aiming - Default: 100 - Range [0 ~ 327]
                           // set a number below 100 for less sens - above 100 for more sens
 
    define OVE_SENS = 100; // Overall sensitivity - Default: 100 - Range [0 ~ 327]
                           // set a number below 100 for less sens - above 100 for more sens
 
    define MIDPOINT = 50/** MIDPOINT - Default: 50 - Range [0 ~ 100]
    If you set a number below 50 you are defining a zone of high sensitivity range when close to rest position
    (fast movements) and a low sensitivity range when far from rest position (better accuracy).
    if you set a number above 50 you are defining a zone of low sensitivity when close to the rest position
    (better accuracy), and a zone of high sensitivity when far from rest position (fast movements).**/

 
    //  VARIABLES
    // ---------------------------------------------------------
    int fire_button, scope_button;
    int anti_recoil;
    int anti_recoil_left;
    int anti_recoil_right;
 
    //  INITIALIZATION
    // ---------------------------------------------------------
    init {
        if(get_console() == PIO_PS3) { // PS3 Trigger & Bumper
            fire_button = 3;
            scope_button = 6;
        } else {                       // Natural Trigger & Bumper
            fire_button = 4;
            scope_button = 7;
        }
    }
    //  MAIN PROCEDURE
    // ---------------------------------------------------------
    main {
        if(!ONLY_WITH_SCOPE || get_val(scope_button)) {
            combo_run(AntiRecoil);
        if (get_val(10) <-80) combo_stop (AntiRecoil);
        }
        if ((get_val(9) <-80) || (get_val(9) > 80)) {
        combo_stop (AntiRecoil);
        }
        if (get_val(ADS_BUTTON) ) {       
            sensitivity( 9, MIDPOINT, ADS_SENS);       
            sensitivity(10, MIDPOINT, ADS_SENS);
        }else{
        // OVERALL SENS
            sensitivity( 9, MIDPOINT, OVE_SENS);
            sensitivity(10, MIDPOINT, OVE_SENS);
        }
    }
    //  COMBOS
    // ---------------------------------------------------------
combo AntiRecoil { // This combo must be the last one
    anti_recoil = get_val(10) + ANTI_RECOIL;
    if(anti_recoil > 100) anti_recoil = 100;set_val(10, anti_recoil);
    anti_recoil_left = get_val(9) -ANTI_RECOIL_LEFT;
    if(anti_recoil_left > 100) anti_recoil_left = 100;set_val(9, anti_recoil_left);
    anti_recoil_right = get_val(9) +ANTI_RECOIL_RIGHT;
    if(anti_recoil_right > 100) anti_recoil_right = 100;set_val(9, anti_recoil_right);
    }