Using GetPlayerKeys()...
#1

Hey everyone... i need to detect a few keys at OnPlayerUpdate for a new epic script i'm working on, only im having a kind of a problem...

I need to get the keys at OnPlayerUpdate, because i need to keep the player from updating when the player is pressing a special key, so i cannot use OnPlayerKeyStateChange because this one is called AFTER the player is being updated!

Now lets say i want to detect the Crouch key at OnPlayerUpdate, i would use this code:
pawn Код:
public OnPlayerUpdate(playerid)
{
    new keys,updown,leftright;
    GetPlayerKeys(playerid,keys,updown,leftright);
    printf("Key pressed: %i",keys);
}
Now i can detect the keys by using the "keys" variable, BUT when you press 2 keys at the same time, as example KEY_ACTION (value 1) and KEY_CROUCH (value 2) together it will output 3 instead of an array as example with [1][2].

Is there any option to get the keycode per key ?
Reply


Messages In This Thread
Using GetPlayerKeys()... - by gamer931215 - 14.01.2012, 22:01
Re: Using GetPlayerKeys()... - by Vince - 14.01.2012, 22:39
Re: Using GetPlayerKeys()... - by gamer931215 - 14.01.2012, 22:45

Forum Jump:


Users browsing this thread: 1 Guest(s)