SA-MP Forums Archive
If player press any 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: If player press any key (/showthread.php?tid=520157)



If player press any key - DarK_FeneR - 17.06.2014

how do I make a function when a player presses any key?


Re: If player press any key - Faisal_khan - 17.06.2014

OnPlayerKeyStateChange
Always ****** first then post here.


Re: If player press any key - DarK_FeneR - 17.06.2014

yes i searched it, but the OnPlayerKeyStateChange, if isn't specified the key, it run if you press only the sprint key... Or fire key, too


Re: If player press any key - Faisal_khan - 17.06.2014

Tip: Directional keys do not trigger OnPlayerKeyStateChange (up/down/left/right). They can only be detected with GetPlayerKeys (in OnPlayerUpdate).


Re: If player press any key - Kimossab - 17.06.2014

Quote:
Originally Posted by DarK_FeneR
View Post
yes i searched it, but the OnPlayerKeyStateChange, if isn't specified the key, it run if you press only the sprint key... Or fire key, too
You can only detect if the player pressed any predifined keys ( https://sampwiki.blast.hk/wiki/Keys ) other than those you can not be detected.


Re: If player press any key - DarK_FeneR - 17.06.2014

ah yes, i look later, thx