SA-MP Forums Archive
Player press N key - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Player press N key (/showthread.php?tid=386408)



Player press N key - SkyWings - 20.10.2012

Hi, how i can create something like this:

If player press N key he gets ClientMessage?


Re: Player press N key - [HK]Ryder[AN] - 20.10.2012

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


Re: Player press N key - SkyWings - 20.10.2012

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


Re: Player press N key - JaKe Elite - 20.10.2012

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




Re: Player press N key - caki - 20.10.2012

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.


Re: Player press N key - SkyWings - 20.10.2012

Thanks all