[HELP] Simple KEY_UP doesnt work.
#1

I am trying to make something happen when you press the arrow up key:

pawn Код:
new Keys,ud,lr;
GetPlayerKeys(playerid,Keys,ud,lr);
if(ud & KEY_UP)
{
That is on a 1 second timer repeating. When I press the arrow key up though, nothing happens.
Any help / advice?
Reply
#2

Quote:
Originally Posted by [HLF
Southclaw ]
KEY_ANALOG_UP Isnt a updown key its a KEYS key if you get my drift!
try this:
pawn Код:
new Keys,ud,lr;
GetPlayerKeys(playerid,Keys,ud,lr);
if(keys & KEY_ANALOG_UP)
{
post updated
Reply
#3

I'm not sure the exact values that GetPlayerKeys return, but down/right are positive and up/left are negative (ud, lr).
so to check if player pressed arrow keys you must check if the ud/lr value is above or below 0. test which is which.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)