[Solved] Clickable TextDraw
#5

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.

pawn Code:
if(keys & KEY_JUMP) { ..
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
Reply


Messages In This Thread
[Solved] Clickable TextDraw - by troy52192 - 28.10.2009, 04:17
Re: Clickable TextDraw - by Jasen - 28.10.2009, 04:58
Re: Clickable TextDraw - by troy52192 - 28.10.2009, 05:11
Re: Clickable TextDraw - by Jasen - 28.10.2009, 05:19
Re: Clickable TextDraw - by Dirty_bum - 28.10.2009, 05:36
Re: Clickable TextDraw - by troy52192 - 28.10.2009, 06:29
Re: Clickable TextDraw - by Jasen - 28.10.2009, 06:43

Forum Jump:


Users browsing this thread: 2 Guest(s)