Noob needs help again
3 posts
• Page 1 of 1
Noob needs help again
still new to this , so im trying to make a if else statement but I cant get it to work so my combo is right trigger then right bumper but if I press b I want b to replace right bumper for one rotation, I know I cant use wait in the if statement as I have it in my cone is there anyway to to make that work to any help would be great
- Code: Select all
int combo_toggle = FALSE;
main {
if(event_press(XB1_RS)) {
combo_toggle = !combo_toggle;
}
if(combo_toggle) {
combo_run(sorkdps);
}
}
combo sorkdps {
// press RT
set_val(XB1_RT, 100);
wait(10);
wait(500);
if(event_press(XB1_B)) { //frag
// press B
set_val(XB1_B, 100);
wait(10);
wait(500);
}else {
//press RB
set_val(XB1_RB, 100);
}
wait(10);
wait(500);
}
-
asilver - Sergeant
- Posts: 6
- Joined: Wed Jul 10, 2019 10:13 am
Re: Noob needs help again
Inside combos is not possible to have branches with wait() inside, try the following:
- Code: Select all
int combo_toggle = FALSE;
main {
if(event_press(XB1_RS)) {
combo_toggle = !combo_toggle;
}
if(combo_toggle) {
combo_run(sorkdps);
}
}
combo sorkdps {
set_val(XB1_RT, 100); // press RT
set_val(XB1_B, 0);
wait(10);
set_val(XB1_B, 0);
wait(500);
if(get_val(XB1_B)) { // frag
set_val(XB1_B, 100); // press B
} else {
set_val(XB1_RB, 100); // press RB
set_val(XB1_B, 0);
}
wait(10);
set_val(XB1_B, 0);
wait(500);
set_val(XB1_B, 0);
}
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
Re: Noob needs help again
thankyou for your help works fine now
-
asilver - Sergeant
- Posts: 6
- Joined: Wed Jul 10, 2019 10:13 am
3 posts
• Page 1 of 1
Return to GPC1 Script Programming
Who is online
Users browsing this forum: No registered users and 83 guests