Just let the player jump again if the c_trace is <4 (or something similar). Otherwise forbid it (use a variable or reassign your jumpkey to NULL).