hey Im stuck
12 posts
• Page 1 of 2 • 1, 2
hey Im stuck
Im totally stuck on this script
these are the combose that I try to cancel when I press RT
not sure but the code doesn't work
Basicly I need to have if I press down DPAD and B the mode activates for no rapid fire
If some one can rework my code that would work too or just the top part where I want rapid fire to stop.
Thanks in advance
- Code: Select all
//MODE FOR NO RAPID FIRE
if(get_val(BUTTON_11) && get_actual(BUTTON_15)) { //ACTIVATES ON: DOWN DPAD + B
norapidfire = !norapidfire;
}
if(norapidfire && event_active(BUTTON_5)) {
combo_stop(rapidfire);
combo_stop(rapidfire2);
}
these are the combose that I try to cancel when I press RT
- Code: Select all
//RAPIDFIRE 1 & 2
if(get_val(ADS_BUTTON) && get_val(FIRE_BUTTON)) { //BOTH TRIGERS PULLED-FAST RAPIDFIRE
combo_run(rapidfire);
combo_stop(rapidfire2);
}else if(get_val(FIRE_BUTTON)) { //RT PULL AND SLOWER RAPIDFIRE
combo_run(rapidfire2);
}
combo rapidfire {
set_val(BUTTON_5, 100.0);
wait(40);
set_val(BUTTON_5, 0.0);
wait(30);
}
combo rapidfire2 {
set_val(BUTTON_5, 100.0);
wait(100);
set_val(BUTTON_5, 0.0);
wait(40);
}
not sure but the code doesn't work
Basicly I need to have if I press down DPAD and B the mode activates for no rapid fire
If some one can rework my code that would work too or just the top part where I want rapid fire to stop.
Thanks in advance
-
alencroat - Lieutenant
- Posts: 320
- Joined: Sun Oct 15, 2017 5:58 pm
Re: hey Im stuck
alencroat wrote:Im totally stuck on this script
- Code: Select all
//MODE FOR NO RAPID FIRE
if(get_val(BUTTON_11) && get_actual(BUTTON_15)) { //ACTIVATES ON: DOWN DPAD + B
norapidfire = !norapidfire;
}
if(norapidfire && event_active(BUTTON_5)) {
combo_stop(rapidfire);
combo_stop(rapidfire2);
}
these are the combose that I try to cancel when I press RT
Because main {} runs multiple, multiple times a second, you may be toggling norapidfire on and off very fast, making it inconsistent. One thing I would try is putting the actual toggle in a combo with a delay. That's a cheap/quick fix.
- Code: Select all
main {
if(get_val(BUTTON_11) && get_actual(BUTTON_15)) { //ACTIVATES ON: DOWN DPAD + B
combo_run(togglerapidfire);
}
}
combo togglerapidfire {
norapidfire = !norapidfire;
wait(0); // This is important, makes sure the previous line only runs once.
wait(250);
}
-
glitchbish - First Sergeant
- Posts: 45
- Joined: Sat Feb 10, 2018 3:11 am
Re: hey Im stuck
awsome thanks for reply gona try
-
alencroat - Lieutenant
- Posts: 320
- Joined: Sun Oct 15, 2017 5:58 pm
Re: hey Im stuck
eeh in other hand could you write the whole fix for me
I understand what you are saying but I dont know how to fix it
I understand what you are saying but I dont know how to fix it
-
alencroat - Lieutenant
- Posts: 320
- Joined: Sun Oct 15, 2017 5:58 pm
Re: hey Im stuck
- Code: Select all
bool norapidfire;
main {
if(get_actual(BUTTON_11) && event_active(BUTTON_15)) { //ACTIVATES ON: DOWN DPAD + B
norapidfire = !norapidfire;
}
if(norapidfire || event_active(BUTTON_5)) {
combo_stop(rapidfire);
combo_stop(rapidfire2);
}
-
Sillyasskid - Captain
- Posts: 574
- Joined: Sat May 14, 2016 3:07 am
Re: hey Im stuck
Awsome silly works like a charm I may have messed up a bool! so thanks allot guys I really appreciate it!
-
alencroat - Lieutenant
- Posts: 320
- Joined: Sun Oct 15, 2017 5:58 pm
Re: hey Im stuck
Hey I got a question to change the condition of turning off the rapidfire, I would like to: If I press and hold BUTTON_2 for more then 500ms then it will turn off rapid fire and also while im pressing down on BUTTON_2 to hit again after those 500ms, basicly Im using it on fortnite, when i click map it will come up when I see map gone I know the rapid fire is ON/OFF.
this is what i got so far
this is what i got so far
- Code: Select all
if(get_val(BUTTON_2) && time_active(BUTTON_2) >= 500) { //ACTIVATES ON: VIEW 500MS hold
norapidfire = !norapidfire;
combo_run(exitmap);
}
if(norapidfire || event_active(BUTTON_5)) {
combo_stop(rapidfire);
combo_stop(rapidfire2);
}
combo exitmap {
wait(50);
set_val(BUTTON_2, 0.00);
wait(50);
set_val(BUTTON_2, 100.00); //view
wait(50);
set_val(BUTTON_2, 0.00);
wait(50);
}
Last edited by alencroat on Sat Feb 24, 2018 4:45 pm, edited 2 times in total.
-
alencroat - Lieutenant
- Posts: 320
- Joined: Sun Oct 15, 2017 5:58 pm
Re: hey Im stuck
actually it doesn't work coding needs work again lol. Problem is that half of time it works and half of times when I try to activate the switch it doesn't work.
I tried all kind of ways but I cant get it to work good
EDIT: I think i found the problem. is if I press and hold VIEW button longer then say 600 it starts the combo again and thats where it messes with the switch
I also found that holding a button has a problem to activate a switch properly for example,
I tried all kind of ways but I cant get it to work good
EDIT: I think i found the problem. is if I press and hold VIEW button longer then say 600 it starts the combo again and thats where it messes with the switch
I also found that holding a button has a problem to activate a switch properly for example,
- Code: Select all
if(get_val(BUTTON_2) && time_active(BUTTON_2) >= 500) {
switch = !switch ;
}
-
alencroat - Lieutenant
- Posts: 320
- Joined: Sun Oct 15, 2017 5:58 pm
Re: hey Im stuck
A extra variable is needed to make this code work properly, example:
- Code: Select all
bool toggle;
bool event_flag;
main {
if(get_val(BUTTON_2) && time_active(BUTTON_2) >= 500) {
if(event_flag == FALSE) {
event_flag = TRUE;
toggle = !toggle ;
}
} else event_flag = FALSE;
}
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
Re: hey Im stuck
Oh sorry but how do I connect that with the above script with rapid fire to stop it from firing?
How do I combine it all
- Code: Select all
#pragma METAINFO("<alen>", 1, 0, "fort")
bool toggle;
bool event_flag;
bool norapidfire;
main {
// if(??? //ACTIVATES ON: view for 500ms
norapidfire = !norapidfire;
}
if(norapidfire || event_active(BUTTON_5)) {
combo_stop(rapidfire);
combo_stop(rapidfire2);
}
if(get_val(BUTTON_2) && time_active(BUTTON_2) >= 500) {
if(event_flag == FALSE) {
event_flag = TRUE;
toggle = !toggle ;
}
} else event_flag = FALSE;
}
combo rapidfire {
set_val(BUTTON_5, 100.0);
wait(40);
set_val(BUTTON_5, 0.0);
wait(30);
}
combo rapidfire2 {
set_val(BUTTON_5, 100.0);
wait(100);
set_val(BUTTON_5, 0.0);
wait(40);
}
//adding combo to the script to cancel out the map
combo exitmap {
wait(50);
set_val(BUTTON_2, 0.00);
wait(50);
set_val(BUTTON_2, 100.00); //view
wait(50);
set_val(BUTTON_2, 0.00);
wait(350);
}
How do I combine it all
-
alencroat - Lieutenant
- Posts: 320
- Joined: Sun Oct 15, 2017 5:58 pm
12 posts
• Page 1 of 2 • 1, 2
Return to GPC2 Script Programming
Who is online
Users browsing this forum: Majestic-12 [Bot] and 142 guests