Generic Anti-Recoil Script

Generic Anti-Recoil Script
Versionv1.00
AuthorConsoleTuner
Publish DateTue, 11 Feb 2014 - 15:50
Last UpdateTue, 11 Feb 2014 - 15:50
Downloads1593
RATE


3

0

Code: Select all
/* *
* ANTI-RECOIL GPC SCRIPT
* *********************************************************** */

 
// Use Anti-recoil only when scoping
define ONLY_WITH_SCOPE = TRUE;
 
// Anti-recoil strongness
// Value range from 0 to 100
// Each weapon may need a specific value
define ANTI_RECOIL = 30;
 
//
// No need to make changes in the code below.
//
 
//
//  VARIABLES
// ---------------------------------------------------------
int fire_button, scope_button;
int anti_recoil;
 
//
//  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);
    }
}
 
//
//  COMBOS
// ---------------------------------------------------------
combo AntiRecoil { // This combo must be the last one
    if(get_val(fire_button)) {
        anti_recoil = get_val(10) + ANTI_RECOIL;
        if(anti_recoil > 100) anti_recoil = 100;
        set_val(10, anti_recoil);
    }
}