Auto movement when Ads for Pubg

GPC2 script programming for Titan Two. Code examples, questions, requests.

Auto movement when Ads for Pubg

Postby Beryl » Sat Mar 20, 2021 5:19 pm

Has anyone got a script i can add to mine, what im looking for is when i aim down sites on pubg LT (xbox) i want to auto move left and right fast when i fire my gun RT?
User avatar
Beryl
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 198
Joined: Fri Nov 27, 2020 7:47 pm

Re: Auto movement when Ads for Pubg

Postby Mad » Sun Mar 21, 2021 1:48 am

Code: Select all
#include <xb1.gph>
#define STRAFE_TIME 100
main {
    if(is_active(XB1_LT) && is_active(XB1_RT)) {
        if(is_release(XB1_LX) * is_release(XB1_LY)) {
            set_val(XB1_LX, clamp((sin(((fix32)system_time()/2500f)*(fix32)STRAFE_TIME) * 100f) * (100f - abs(get_val(XB1_LX))) / 100. + get_actual(XB1_LX), -100., 100.));
        }
    }
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord (2K / FPS)
Mad
Major General
Major General
 
Posts: 4532
Joined: Wed May 22, 2019 5:39 am

Re: Auto movement when Ads for Pubg

Postby Beryl » Tue Apr 13, 2021 12:58 pm

thanks will try sorry just logged back in!
User avatar
Beryl
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 198
Joined: Fri Nov 27, 2020 7:47 pm

Re: Auto movement when Ads for Pubg

Postby Beryl » Tue Jun 22, 2021 6:33 am

Mad wrote:
Code: Select all
#include <xb1.gph>
#define STRAFE_TIME 100
main {
    if(is_active(XB1_LT) && is_active(XB1_RT)) {
        if(is_release(XB1_LX) * is_release(XB1_LY)) {
            set_val(XB1_LX, clamp((sin(((fix32)system_time()/2500f)*(fix32)STRAFE_TIME) * 100f) * (100f - abs(get_val(XB1_LX))) / 100. + get_actual(XB1_LX), -100., 100.));
        }
    }
}



Noob question but what do i change to increase the straff? All i want is it abit bigger so it gives me a harder target to hit when spraying?
User avatar
Beryl
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 198
Joined: Fri Nov 27, 2020 7:47 pm


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 87 guests