Own Keys Define
#1

Hello How can i define own keys.

Example

#define KEY_M ??
#define KEY_J ??

if(newkeys == KEY_M) {
print("you have press M on you keyboard";
} else if(newkeys == KEY_J) {
print("you have press J on you keyboard";
} and and and

Ђdit: but for all keys and numbers on the keyboard.

Can you help me?

Sorry for my bad english.
Reply
#2

It's impossible unfortunately,hopefully will be possible in following versions.
And just to prevent future mistakes for you,key checks are with '&' and not '=='.
pawn Код:
if(newkeys & KEY_WHATEVER)
EDIT:
https://sampwiki.blast.hk/wiki/GetPlayerKeys
Scroll down and see a list of available keys.
Reply
#3

Hello,

i have already do this code but at the key m and j this line are emtpy

Код:
new keys, ud, lr, string[64];
GetPlayerKeys(playerid, keys,ud,lr);
format(string, sizeof(string), "KEY = %d ,UD = %d,LR = %d", keys , ud , lr);
SendClientMessage(playerid, 0xFFFFFFFF, string);
print(string);
Edit: I have a code that i must only do if(pressed(KEY)) return /* CODE */ ;^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)