Weird key detecting
#1

Ok, I'm having some weird problems with OnPlayerKeyStateChange here ..

For some reason, it calls KEY_SPRINT when I press the forward key, but only when in a vehicle. The Wiki clearly states that OnPlayerKeyStateChange doesn't get called for updown and leftright. And, on top of that, KEY_UP is defined as 128 ...

pawn Код:
#define PRESSED(%0) \
        (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))

    if(PRESSED(KEY_SPRINT))
    {
        printf("[debug] Found: KEY_SPRINT - %d", KEY_SPRINT);
        ClearAnimations(playerid);
        SetPlayerSpecialAction(playerid, 0);
        return 1;
    }
Output from console:
Код:
[21:09:18] [debug] Found: KEY_SECONDARY_ATTACK - 16 // I enter a vehicle
[21:09:22] [debug] Found: KEY_SPRINT - 8 // I press the accelerate key
Note that I got the defines from the wiki as well!
Reply


Messages In This Thread
Weird key detecting - by Vince - 28.08.2010, 19:14
Re: Weird key detecting - by Mike_Peterson - 28.08.2010, 19:25
Re: Weird key detecting - by Vince - 28.08.2010, 20:05

Forum Jump:


Users browsing this thread: 1 Guest(s)