Quote:
Originally Posted by Kye
The keys are a set of bits. Multiple keys/buttons can be pressed at the same time. So rather than using == or - you should use bitwise &.
pawn Code:
if(keys == KEY_JUMP) { ..
That detects if only the jump key is pressed and no other keys. For example, that condition would be false if the player pressed both KEY_SPRINT and KEY_JUMP at the same time.
That detects if the KEY_JUMP key is pressed in combination with any other key.
pawn Code:
IsKeyJustDown(key, newkeys, oldkeys) { if((newkeys & key) && !(oldkeys & key)) return 1; return 0; }
|
Hope that helps for 2 Keys at once thingy