Activate a button press on straff left to right request
13 posts
• Page 2 of 2 • 1, 2
Re: Activate a button press on straff left to right request
Apologies to ask but any chance you could add button 5 in place of the d pad up on the origional code? The 1 where i crouch then activate then stand up etc. My aim is i found when shooting spamming the movement left right improved the shooting whilst activating the crouch manovere. I tried removing the bottom part of the latest code but messed it up.
So basicly long winded post cut shot i want to use both the bottom 1 as its perfect and a version where it activates on fire where every activation makes me crouch or stand back up.
Sorry if this doesnt make sense
So basicly long winded post cut shot i want to use both the bottom 1 as its perfect and a version where it activates on fire where every activation makes me crouch or stand back up.
Sorry if this doesnt make sense
-
Beryl - Sergeant Major of the Army
- Posts: 198
- Joined: Fri Nov 27, 2020 7:47 pm
Re: Activate a button press on straff left to right request
Not sure if this is what you are asking for:
- Code: Select all
#define LX_MOVEMIN 10 // stick have to be move more than that value for crouch
#define LX_TIMEMAX 20 // max time (ms) between left/right for crouch
uint32 LXL, LXR;
main {
if (get_actual(BUTTON_5)) { // only works now while fire is pressed
if (get_actual(STICK_2_X) > (fix32) LX_MOVEMIN) {
LXR = system_time();
if (LXR - LXL < LX_TIMEMAX) combo_run(cCrouch);
}
if (get_actual(STICK_2_X) < (fix32)-LX_MOVEMIN) {
LXL = system_time();
if (LXL - LXR < LX_TIMEMAX) combo_run(cCrouch);
}
}
}
combo cCrouch {
set_val(BUTTON_15, 100); wait(80); // stand/crouch
wait(200); // keeping current stance
// set_val(BUTTON_15, 100); wait(80); // crouch/stand
}
-
Scachi - Brigadier General
- Posts: 3044
- Joined: Wed May 11, 2016 6:25 am
- Location: Germany
Re: Activate a button press on straff left to right request
Thankyou will give this a try later
-
Beryl - Sergeant Major of the Army
- Posts: 198
- Joined: Fri Nov 27, 2020 7:47 pm
13 posts
• Page 2 of 2 • 1, 2
Return to GPC2 Script Programming
Who is online
Users browsing this forum: Baidu [Spider] and 110 guests