17.03.2017, 22:00
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
As for your problem, I don't know. Is the teleport working but the message not sending?
Quote:
How NOT to check for a key Let's presume that you want to detect when a player presses their FIRE button, the obvious code would be: Код:
if (newkeys == KEY_FIRE) |
Quote:
How to check for a key So, if the variable can contain multiple keys at once, how do you check for just a single one? The answer is bit masking. Each key has its own bit in the variable (some keys have the same bit, but they are onfoot/incar keys, so can never be pressed at the same time anyway) and you need to check for just that single bit: Код:
if (newkeys & KEY_FIRE) |