Help with 360° Run script
5 posts
• Page 1 of 1
Help with 360° Run script
Can anyone help me with this script, i want to be able to move with the left analog with a delay before the run buttons pressed?
Currently sometimes it doent activate the run, hope this makes sense
So can someone add in a delay for AFTER left analog is moved in any direction to press the run button. Thanks
Currently sometimes it doent activate the run, hope this makes sense
So can someone add in a delay for AFTER left analog is moved in any direction to press the run button. Thanks
- Code: Select all
main {
if(sqrt(sq(get_actual(STICK_2_X)) + sq(get_actual(STICK_2_Y))) >= 90f) {
combo_run(Sprint);
}
}
combo Sprint {
set_val(BUTTON_17, 100);
-
Beryl - Sergeant Major of the Army
- Posts: 198
- Joined: Fri Nov 27, 2020 7:47 pm
Re: Help with 360° Run script
- Code: Select all
#define dSprint 200 // delay before sprint
uint32 tSprint;
main {
if(sqrt(sq(get_actual(STICK_2_X)) + sq(get_actual(STICK_2_Y))) >= 90f) {
tSprint += elapsed_time();
if (tSprint > dSprint) combo_run(cSprint);
} else {
tSprint = 0;
}
}
combo cSprint {
set_val(BUTTON_17, 100);
}
-
Scachi - Brigadier General
- Posts: 3044
- Joined: Wed May 11, 2016 6:25 am
- Location: Germany
Re: Help with 360° Run script
Thankyou! Idiot question is tSprint = 0 the bit i edit for the delay, rather ask before i mess about with it
-
Beryl - Sergeant Major of the Army
- Posts: 198
- Joined: Fri Nov 27, 2020 7:47 pm
Re: Help with 360° Run script
Ignore that just see it says at top
-
Beryl - Sergeant Major of the Army
- Posts: 198
- Joined: Fri Nov 27, 2020 7:47 pm
Re: Help with 360° Run script
Just tried, its perfect thanks for your help!
-
Beryl - Sergeant Major of the Army
- Posts: 198
- Joined: Fri Nov 27, 2020 7:47 pm
5 posts
• Page 1 of 1
Return to GPC2 Script Programming
Who is online
Users browsing this forum: AZOV_ops and 125 guests