SA-MP Forums Archive
Defining an undefined key. - 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: Defining an undefined key. (/showthread.php?tid=263393)



Defining an undefined key. - [RVRP]Tyler - 21.06.2011

How exactly do I define KEY_LEFT. In the wiki it says that I must define it myself. I have it used under OnPlayerKeyStateChange but it has no affect, so I'm guessing it's because it must be defined.


Re: Defining an undefined key. - danodanodano - 21.06.2011

Write at the top of the script
Код:
#define KEY_LEFT



Re: Defining an undefined key. - [RVRP]Tyler - 21.06.2011

Quote:
Originally Posted by danodanodano
Посмотреть сообщение
Write at the top of the script
Код:
#define KEY_LEFT
........

______________

I'm trying to use the left and right arrow keys as a part of a tutorial, where the player is standing still and they press the keys to flip back and fourth through the slides.


Re: Defining an undefined key. - Sasino97 - 21.06.2011

Quote:
Originally Posted by danodanodano
Посмотреть сообщение
Write at the top of the script
Код:
#define KEY_LEFT
............


Re: Defining an undefined key. - xRyder - 21.06.2011

I think KEY_LEFT is predefined.


Quote:
Originally Posted by danodanodano
Посмотреть сообщение
Write at the top of the script
Код:
#define KEY_LEFT
I couldn't stop laughing when I saw this...


Re: Defining an undefined key. - iggy1 - 21.06.2011

You can't detect the arrow keys with the callback OnPlayerKeyStateChange. You also can't define new keys. To detect arrow keys you should use GetPlayerKeys in OnPlayerUpdate, or a timer.

Example is on the wiki here https://sampwiki.blast.hk/wiki/GetPlayerKeys


Re: Defining an undefined key. - Sasino97 - 21.06.2011

Quote:
Originally Posted by xRyder
Посмотреть сообщение
I think KEY_LEFT is predefined.




I couldn't stop laughing when I saw this...
me too DD