[HELP] Simple KEY_UP doesnt work. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Simple KEY_UP doesnt work. (
/showthread.php?tid=96042)
[HELP] Simple KEY_UP doesnt work. -
Yoyoyo - 06.09.2009
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?
Re: [HELP] Simple KEY_ANALOG_UP doesnt work. -
Yoyoyo - 06.09.2009
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
Re: [HELP] Simple KEY_UP doesnt work. -
Macluawn - 19.01.2011
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.