How to make a key for a cmd
#1

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.
Reply
#2

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
Reply
#3

Most people just use AutoHotKey http://www.autohotkey.com/ but OnplayerKeyStateChange() will work.
Reply
#4

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.
Reply
#5

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
Most people just use AutoHotKey http://www.autohotkey.com/ but http://www.autohotkey.com/ will work.
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.
Reply
#6

lol you quoted my failed post before I edited it read it again.
Reply
#7

Thanks for help .
Reply
#8

Use OnPlayerKeyStateChange() Look it up in SAMP Wiki
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)