Defining an undefined key.
#1

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.
Reply
#2

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

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.
Reply
#4

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

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...
Reply
#6

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
Reply
#7

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




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


Forum Jump:


Users browsing this thread: 1 Guest(s)