Sounds like you're creating a manual jump button.
I think C2 has a built-in Platformer engine that disables continuous jumping like you described, however, if you'd like to implement it yourself, I suggest using a Boolen.
For [BUTTON PRESSED] | Player Jumps
JUMP_BOOLEAN = 0 |
For [ANY BUTTON PRESSED END] | Player descends
For X [BUTTON PRESSED] | JUMP_BOOLEAN = 1
For Player is Overlapping with ground | JUMP_BOOLEAN = 0
Or something like that. As you can see player is only able to jump when colliding with ground.
Of course, you'd have to fix it so player can't jump every time it's colliding with solid otherwise it'll do Wall jumps.