What is AHK?
In simple words, AHK is a keybinder not specifically for SA:MP but for the entire Windows OS. You can learn more about it on their website. We'll only be discussing uses of AHK in SA:MP here.
AHK script basics and how to get going:
After you download and install AHK, do the following steps to make an AHK script file:
Desktop > Press RMB > New > Create a AHK Script > Press RMB on the script > Edit Script > Erase all the shit that's already written there
When you're done with that, you can start writing your first ever bind for SAMP, yay!
Starting off, you'll want to copy-paste the following on the top of your Notepad script so your script only works for SA:MP.
A SA:MP script would typically contain the following:
KEY:: (By pressing this, you'll activate your BIND)
SendInput (This is the action that will take place once you press the button above)
Return (This marks the end of your bind)
A cute example:
Code: Select all
Numpad1::
SendInput t/engine{ENTER}
return
The script above turns on/off your vehicle's engine when you press Numpad 1. Pretty self-explanatory. After you're done, close the Notepad and hit SAVE after which you can double click the AHK file on your Desktop (A icon should appear on the taskbar below after it) to open it and use it in-game. Editing it later is almost the same process, you 'Edit Script' and then after you're done, you can open the taskbar, press RMB on the script file and hit "Reload Script."
Some useful scripts:
=>/ftakegun War Script | Automatically takes 1x Deagle and 2x M4's from the fstock when you press Numpad7
Code: Select all
Numpad7::
wait = 350 ; Milliseconds
SendInput t/ftakegun{ENTER}
Sleep, %wait%
SendInput {ENTER}
Sleep, %wait%
SendInput {DOWN 4}{ENTER}
Sleep, %wait%
SendInput {DOWN 4}{ENTER}
Sleep, %wait%
SendInput {ESC}
return
->/givegun script for factions | Automatically uses /heal and /givegun for you when you press Numpad6
Code: Select all
Numpad6::
wait = 350 ; Milliseconds
SendInput t/heal{ENTER}t/givegun{ENTER}
Sleep, %wait%
SendInput {ENTER}
Sleep, %wait%
SendInput {ESC}
return
-> Instant carfix | The title says it all.
Code: Select all
Numpad2::
SendInput t/engine{ENTER}t/car fix{ENTER}t/engine{ENTER}
return
-> Anti-MG | Horny people reporting you for saying "LOL" IC? Here's a fix with AHK. Whenever you say shit like "LOL" "WTF" it automatically changes it to the roleplay term for it. Example: LOL will turn to /me laughs out loud.
This is for those who use ` to open chat like me:
Code: Select all
::``lol::/me laughs out loud.
return
::``omg::/s Oh my god{!}
return
::``omfg::/s Oh my fucking god{!}
return
::``ty::Thanks.
return
::``wtf::/s What the fuck?{!}
return
::``stfu::/s Shut the fuck up{!}
return
::``ty::Thank you.
return
And this is for those who use T to open chat:
Code: Select all
::tlol::/me laughs out loud.
return
::tomg::/s Oh my god{!}
return
::tomfg::/s Oh my fucking god{!}
return
::tty::Thanks.
return
::twtf::/s What the fuck?{!}
return
::tstfu::/s Shut the fuck up{!}
return
-> Abbreviations - Shortened versions for the long ass commands because we're all lazy, right?
For people who use ` to open the chat
Code: Select all
::`/th::/tracehouse
::`/tb::/tracebiz
::`/tn::/tracen
::`/tp::/traceplate
For people who use T to open the chat
Code: Select all
::t/th::/tracehouse
::t/tb::/tracebiz
::t/tn::/tracen
::t/tp::/traceplate
Probably gonna post more scripts as we go forward but this is all for now. Hit me up on Discord (Aman_#8696) if you encounter a problem or use SAMP Addon. I take in-game cash only, ty.