Own Keys Define - 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: Own Keys Define (
/showthread.php?tid=171737)
Own Keys Define -
privatecitypage - 27.08.2010
Hello How can i define own keys.
Example
#define KEY_M
![Huh?](images/smilies/confused.gif)
??
#define KEY_J
![Huh?](images/smilies/confused.gif)
??
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.
Re: Own Keys Define -
[XST]O_x - 27.08.2010
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.
Re: Own Keys Define -
privatecitypage - 27.08.2010
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 */ ;^^