how would..?
#1

Pressing a key for a few seconds (while pressing) shows the function.

is for OnPlayerKeyStateChange.

Do any idea how is possible?
Reply
#2

This?

pawn Код:
#define HOLDING(%0) \
    ((newkeys & (%0)) == (%0))
pawn Код:
if(HOLDING(YOUR_KEY))
{
      //Yourcode
}
Reply
#3

Quote:
Originally Posted by Alteh
Посмотреть сообщение
Pressing a key for a few seconds (while pressing) shows the function.

is for OnPlayerKeyStateChange.

Do any idea how is possible?
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange

Read
Holding key part
Reply
#4

I know already what is holding key. OP said "Pressing a key for few seconds", so it's holding?

@OP: Check @khRamin's link to get an idea.
Reply
#5

Quote:
Originally Posted by KinderClans
Посмотреть сообщение
This?

pawn Код:
#define HOLDING(%0) \
    ((newkeys & (%0)) == (%0))
pawn Код:
if(HOLDING(YOUR_KEY))
{
      //Yourcode
}
Quote:
Originally Posted by ******
Посмотреть сообщение
Start a timer in OnPlayerKeyStateChange when they start pressing the key. Kill the timer in the same place if they ever release it. Then do what you want in the timer function.

very thanks! i was able to do it!
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)