How to make a key for a cmd - 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 make a key for a cmd (
/showthread.php?tid=440231)
How to make a key for a cmd -
OmarT2 - 28.05.2013
Hello , I want to know how to assign a key for a cmd . Like when a police wants to make /siren he just press his "N" key on his keyboard and the police lights will be put on his car.
Re: How to make a key for a cmd -
IceCube! - 28.05.2013
Well you use the Public included with new.pwn
OnplayerKeyStateChange()
I wont go into detail with this as the SAMP Wiki describes this well.
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
Re: How to make a key for a cmd -
Pottus - 28.05.2013
Most people just use AutoHotKey
http://www.autohotkey.com/ but OnplayerKeyStateChange() will work.
Re: How to make a key for a cmd -
Konewka - 28.05.2013
You can do that using zcmd I guess.
https://sampforum.blast.hk/showthread.php?tid=91354
@up: I think he's point is to do the same thing when pressing a key as a command /siren. In order to do that he can use whether include or write the same code again into callback.
Re: How to make a key for a cmd -
IceCube! - 28.05.2013
Quote:
Originally Posted by [uL]Pottus
|
He doesn't mean on the clients side but on the server, using the YES and NO keys most likely.
You know what really grinds my gears:
This forum requires that you wait 120 seconds between posts. Please try again in 61 seconds.
Re: How to make a key for a cmd -
Pottus - 28.05.2013
lol you quoted my failed post before I edited it read it again.
Re: How to make a key for a cmd -
OmarT2 - 29.05.2013
Thanks for help .
Re: How to make a key for a cmd -
CROSS_Hunter - 29.05.2013
Use OnPlayerKeyStateChange() Look it up in SAMP Wiki
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange