Player press N key
#1

Hi, how i can create something like this:

If player press N key he gets ClientMessage?
Reply
#2

You can only detect keys that are predefined in san andreas such as key_fire or something. i dont think N is one of them.
You can use it if you tell your players to assign N to the fire key or something..sop if you detect key_fire he wud be pressing N
:P
Reply
#3

Thanks for information, but how i can create command with Num 8?
Reply
#4

Quote:
Originally Posted by [HK]Ryder[AN]
View Post
You can only detect keys that are predefined in san andreas such as key_fire or something. i dont think N is one of them.
You can use it if you tell your players to assign N to the fire key or something..sop if you detect key_fire he wud be pressing N
:P
No no no, Key N is available.

Search before posting that.

SkyWings

Put this OnPlayerKeyStateChange

PHP Code:
if(newkeys KEY_NO//KEY_NO = N
{
//code here

Reply
#5

You must use define if pressed
PHP Code:
#define PRESSED(%0) \
    
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
then use where you want i suggest OnPlayerKeyStateChange
        
if (PRESSED(KEY_NO))
    {
        
//do something here
    

I hope you understand it now.
Reply
#6

Thanks all
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)