How to indentify user press a 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: How to indentify user press a key? (
/showthread.php?tid=556730)
How to indentify user press a key? -
vinnythebest - 11.01.2015
Hi,
I've this request. How the server can indentify user press a any key?
I need it for a "alert" of user, after control of S-obeit on my Server.
Re: How to indentify user press a key? -
zT KiNgKoNg - 11.01.2015
Try using ******.... These are the keys that you're able to use in SA-MP (script side) other than that its not possible without a server and client side plugin (
https://sampwiki.blast.hk/wiki/Keys).
Re: How to indentify user press a key? -
FunnyBear - 11.01.2015
Using OnPlayerKeyStateChange. Here is an example of what happens when a player presses the F key
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_SECONDARY_ATTACK)
{
SendClientMessage(playerid, -1, "You pressed the F key!");
}
return 1;
}
You can view a list of keys and their names,
https://sampwiki.blast.hk/wiki/Keys
Re: How to indentify user press a key? -
vinnythebest - 11.01.2015
Solved, with DIALOG_STYLE_MSGBOX the user can't press a keys and he can wait a finish of control