Post by Brazoka123 on Sept 29, 2015 12:37:17 GMT 2
Hey there!
Because some people asked for it (and I kind of promised it), here is my tutorial on AutoHotkey, which is the keybind software I use. There are easier keybinders for SA:MP, but this one allows much more customization, like 2 command on 1 key and loops (which I won’t explain since they are kind of useless in SA:MP).
Let’s get started!
First of all, you need to download AutoHotkey at www.autohotkey.com/ .Just click on the big download button:
After that, do what the installation thing tells you to do.
When it’s all installed, go to the place where you want to script to be. Next, use your right-mouse button and hover over “New” and select “AutoHotkey Script”:
Now, give it a name and right-click on the file you just made. Click on “Edit Script”:
Let’s start coding!
Alright, so if everything went okay you are now in Notepad. Delete everything you see in the script right now, we won’t use. Put the following at the top:
This will make the script only work if your GTA is open, so it won’t do anything if you go alt-tab to Spotify for example.
Now you can set up your keybinds. In AutoHotkey, it looks like this:
The keyis the key that triggers the action and the return tells AHK to stop performing the actions so it won’t keep going on forever.
The keys you can use are all listed here: www.autohotkey.com/docs/KeyList.htm
So for example, if you want your numberpad 1 key to type /arrest and a space so you can type the ID and press enter, you do this:
SendInput tells AHK to send the keys you typed behind it. The t will open the chatbox, and then it will type /cuff and a space, which AHK only types if it’s typed as {SPACE}. This also applies to pressing enter in AHK, which I will show later.
In this example, AHK doesn’t need to press enter because you still need to type the ID. Unfortunately, AFK can’t see which playerid is the closest to your SA:MP player (which would be totally unfair of course).
I HOPE MY TUTORIAL HELPED YOU GUYS
Because some people asked for it (and I kind of promised it), here is my tutorial on AutoHotkey, which is the keybind software I use. There are easier keybinders for SA:MP, but this one allows much more customization, like 2 command on 1 key and loops (which I won’t explain since they are kind of useless in SA:MP).
Let’s get started!
First of all, you need to download AutoHotkey at www.autohotkey.com/ .Just click on the big download button:
After that, do what the installation thing tells you to do.
When it’s all installed, go to the place where you want to script to be. Next, use your right-mouse button and hover over “New” and select “AutoHotkey Script”:
Now, give it a name and right-click on the file you just made. Click on “Edit Script”:
Let’s start coding!
Alright, so if everything went okay you are now in Notepad. Delete everything you see in the script right now, we won’t use. Put the following at the top:
1: #IfWinActive, GTA:SA:MP
This will make the script only work if your GTA is open, so it won’t do anything if you go alt-tab to Spotify for example.
Now you can set up your keybinds. In AutoHotkey, it looks like this:
1: Key::
2: Action
3: return
The keyis the key that triggers the action and the return tells AHK to stop performing the actions so it won’t keep going on forever.
The keys you can use are all listed here: www.autohotkey.com/docs/KeyList.htm
So for example, if you want your numberpad 1 key to type /arrest and a space so you can type the ID and press enter, you do this:
5: Numpad1::
4: SendInput t/cuff{SPACE}
3: return
SendInput tells AHK to send the keys you typed behind it. The t will open the chatbox, and then it will type /cuff and a space, which AHK only types if it’s typed as {SPACE}. This also applies to pressing enter in AHK, which I will show later.
In this example, AHK doesn’t need to press enter because you still need to type the ID. Unfortunately, AFK can’t see which playerid is the closest to your SA:MP player (which would be totally unfair of course).
I HOPE MY TUTORIAL HELPED YOU GUYS