Hello, I have been trying to make a check to see if the "W" button has been pressed twice. I have tried multiple methods from the forums and my own, but none of them seemed to work.
What I have atm
static buttons, oldbuttons;
leap_time = get_gametime()
buttons = get_uc(handle, UC_Buttons);
oldbuttons = pev(id, pev_oldbuttons);
if (!g_isbot[id] && IN_FORWARD)
last_button_press = get_gametime();
// Not doing a longjump (don't perform check for bots, they leap automatically)
if (!g_isbot[id] && !IN_FORWARD && buttons != oldbuttons && (leap_time - last_button_press) < 0.5)
The original code is from zombie plague 4.3 mod, I have tried to modify it to perform a long jump/leap when a user presses the "W" or forward button twice.