OnPlayerKeys ... what keys ? how ?
#1

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

https://sampwiki.blast.hk/wiki/GetPlayerKeys
Reply
#3

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

YOU THNX GUYS !!! I :P YOU !!!
btw ... how is the "+" called ?
Reply
#5

sorry, can't be.. mybad
Reply
#6

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

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

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

Lol nice Very usefull.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)