OnPlayerKeys ... what keys ? how ? - 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: OnPlayerKeys ... what keys ? how ? (
/showthread.php?tid=79012)
OnPlayerKeys ... what keys ? how ? -
Divine - 24.05.2009
You guys !
I was wodering ... where can I find the "keys" functions thingy ..
Like ... In some server when you press "2" , it adds nitro ...
But how do I detect that he is pressing the "2" ... or any other buttons that are avalable ?
...
ex: I wanna locate the "+" button, so when you press it, it does something..
or any other button ? any list avalable maybe ?
...
THNX in advance

...
p.s. what does "player bad weapons" do ? and how I use it ? :P
Re: OnPlayerKeys ... what keys ? how ? -
Weirdosport - 24.05.2009
https://sampwiki.blast.hk/wiki/GetPlayerKeys
Re: OnPlayerKeys ... what keys ? how ? -
Correlli - 24.05.2009
These are available keys from a_samp.inc.
pawn Код:
// Keys
#define KEY_ACTION (1)
#define KEY_CROUCH (2)
#define KEY_FIRE (4)
#define KEY_SPRINT (8)
#define KEY_SECONDARY_ATTACK (16)
#define KEY_JUMP (32)
#define KEY_LOOK_RIGHT (64)
#define KEY_HANDBRAKE (128)
#define KEY_LOOK_LEFT (256)
#define KEY_SUBMISSION (512)
#define KEY_LOOK_BEHIND (512)
#define KEY_WALK (1024)
#define KEY_ANALOG_UP (2048)
#define KEY_ANALOG_DOWN (4096)
#define KEY_ANALOG_RIGHT (16384)
#define KEY_ANALOG_LEFT (8192)
#define KEY_UP (65408)
#define KEY_DOWN (128)
#define KEY_LEFT (65408)
#define KEY_RIGHT (128)
Re: OnPlayerKeys ... what keys ? how ? -
Divine - 24.05.2009
YOU THNX GUYS !!! I :P YOU !!!
btw ... how is the "+" called ?
Re: OnPlayerKeys ... what keys ? how ? -
Lorrden - 24.05.2009
sorry, can't be.. mybad
Re: OnPlayerKeys ... what keys ? how ? -
Divine - 24.05.2009
Quote:
Originally Posted by ¤- Lorrden -¤
secondary attack i think
|
Im not sure ... cus when u press "+" the car "jumps" with hydraulics ...
but thnx for help

I try to find it my self by testing :P
Re: OnPlayerKeys ... what keys ? how ? -
Weirdosport - 24.05.2009
Quote:
Originally Posted by Divine
I try to find it my self by testing :P
|
Easiest way to test:
pawn Код:
//top of script
new string[4], tempkey;
// In OnPlayerKeyStateChange
tempkey = newkeys - oldkeys;
format(string, sizeof(string), "%d", tempkey);
SendClientMessage(playerid, 0xFF00FFFF, string);
Everytime you press a button it will post saying the "button id". When you take your finger off a key it will give the same value, but negative.
Re: OnPlayerKeys ... what keys ? how ? -
Divine - 24.05.2009
Quote:
Originally Posted by Weirdosport
Everytime you press a button it will post saying the "button id". When you take your finger off a key it will give the same value, but negative.
|
THNX !!!
Re: OnPlayerKeys ... what keys ? how ? -
Uninvited - 06.05.2010
Lol nice

Very usefull.