Check keys.
#1

Hi,

I want to check if player is holding left mouse button and pressed right mouse button.

It's exist mouse buttons in car?
Reply
#2

You can use this Macro
pawn Код:
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
The Macro was not made by me i got it from the XtremePlanet GM
Reply
#3

I have this, but what key is mouse?
Reply
#4

Under OnPlayerKeyStateChange Monitor for key changes now let's say you want,
to check the player's submission key, mouse key, we do like the following,
pawn Код:
if(PRESSED(KEY_FIRE))
{
    // Do Something You Like Here
    return 1;
}
Reply
#5

KEY_FIRE is left mouse click? and what is right mouse click?
Reply
#6

Check this https://sampwiki.blast.hk/wiki/GetPlayerKeys,
and this https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)