MercenaryKings-Rapid Fire,Knife,Roll & Adjustable Reload (PS4)

This is self explanatory: Rapidfire. Rapidknife - useful for blocking bullets. Rapidroll - useful for speed runs. Adjustable reload for perfect reload, only works if still ammo in clip. Bolt45 - Reload times for different Mags. Standard: 700, Sturm rifle: 1200, Artillery jager: 1200, Patrol Rifle: 880, Recon Rifle: 700, Spiral: 880, Kar: 750, Mand=940, Steel=900. ** Add me PSN: RoR_UK. Join: XpUp.net. I would like to create something to cover the auto reload when your ammo runs out. Not sure how to program based upon button being held for amount of time. Any help appreciated. Thanks RoR
Version2
AuthorRoR
Publish DateSun, 13 Apr 2014 - 15:11
Last UpdateSun, 13 Apr 2014 - 15:11
Downloads114
RATE


2

0

Code: Select all
/* *
* GPC SCRIPT
*
*  GPC is a scripting language with C-like syntax.
*  To learn more access GPC Online Help on Help menu.
 
*  Perfect Reloadtime Custom weapon Mags.
*
*  Change Reloadtime below to suit the perfect reload time */

 
    define Reloadtime = 750;
 
// No more changes should be needed
 
    define RAPIDFIRE_BUTTON1 = PS4_SQUARE;
    define RAPIDFIRE_BUTTON2 = PS4_TRIANGLE;
    define RAPIDFIRE_BUTTON3 = PS3_CIRCLE;
    define PERFECT_RELOAD = PS4_R1;
    define SCRIPTSWITCH = PS4_L3;
 
    define RATE_OF_FIRE1 = 25
    define RATE_OF_FIRE2 = 25
 
    int hold_time1, rest_time1;
    int hold_time2, rest_time2;
 
    init {
        hold_time1 = 500 / RATE_OF_FIRE1;
        rest_time1 = hold_time1 - 20;
        if(rest_time1 < 0) rest_time1 = 0;
 
        hold_time2 = 500 / RATE_OF_FIRE2;
        rest_time2 = hold_time2 - 20;
        if(rest_time2 < 0) rest_time2 = 0;
    }
 
    main {
 
        if(get_val(RAPIDFIRE_BUTTON1)) {
            combo_run(RapidFire1);
        } else if(combo_running(RapidFire1)) {
            combo_stop(RapidFire1);
        }
 
        if(get_val(RAPIDFIRE_BUTTON2)) {
            combo_run(RapidFire2);
        } else if(combo_running(RapidFire2)) {
            combo_stop(RapidFire2);
        }
 
        if(get_val(RAPIDFIRE_BUTTON3)) {
            combo_run(RapidFire3);
        } else if(combo_running(RapidFire3)) {
            combo_stop(RapidFire3);
        }
 
        if(get_val(PERFECT_RELOAD)) {
            combo_run(Reload1);
        }
    }
 
    combo RapidFire1 {
        set_val(RAPIDFIRE_BUTTON1, 100);
        wait(hold_time1);
        set_val(RAPIDFIRE_BUTTON1, 0);
        wait(rest_time1);
        set_val(RAPIDFIRE_BUTTON1, 0);
    }
 
    combo RapidFire2 {
        set_val(RAPIDFIRE_BUTTON2, 100);
        wait(hold_time2);
        set_val(RAPIDFIRE_BUTTON2, 0);
        wait(rest_time2);
        set_val(RAPIDFIRE_BUTTON2, 0);
    } 
 
    combo RapidFire3 {
        set_val(RAPIDFIRE_BUTTON3, 100);
        wait(hold_time2);
        set_val(RAPIDFIRE_BUTTON3, 0);
        wait(rest_time2);
        set_val(RAPIDFIRE_BUTTON3, 0);
    } 
 
    combo Reload1 {
        set_val(PS4_R1, 100);
        wait(50);
        set_val(PS4_R1, 0);
        wait(Reloadtime);
        set_val(PS4_R1, 100);
        wait(30);
        set_val(PS4_R1, 0);
    }