Keys in other callback's.
#1

Hi. How i can check player pressed key, in my public? i mean i have a timer, and i want to check in him if player pressed a key like:

Код:
forward MYPUBLIC( playerid );
public MYPUBLIC( playerid )
if (PRESSED( KEY_HANDBRAKE ) )
{
//ACTION.
}
But i will get error, because newkeys is unknow and oldkeys. Maybe can help with this?
Reply
#2

GetPlayerKeys
Reply
#3

Try:

pawn Код:
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
Lots of info here:

https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
https://sampwiki.blast.hk/wiki/GetPlayerKeys
Reply
#4

Thanks. Maybe is a key ( S ) ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)