There is currently a faction war going on! View Stats
Ralph_
Donator
User avatar
Posts: 1833
Game name: Ralph_Toretto, Raphael_TinToretto

(AHK) AutoHotKey | War scripts e.t.c. included (10/5/2020)

May 10th, 2020, 6:53 pm

Image
Download link to the latest version: Click Here

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.

Code: Select all

#IfWinActive, GTA: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.
Last edited by Ralph_ on August 14th, 2020, 10:24 pm, edited 2 times in total.
Don’t let your mouth write a cheque that your ass can’t cash.

Golden
Outsider
User avatar
Posts: 294
Game name: Gottardo_Massalsky, Yulian_Massalsky

Re: (AHK) AutoHotKey | War scripts e.t.c. included (10/5/2020)

May 10th, 2020, 7:03 pm

u da real mvp my man

Zlaja
Soldier
User avatar
Posts: 3590
Game name: Murga_Drot, Jamal_Hayes, Sammy_Vizzini, Garry_Cunningham

Re: (AHK) AutoHotKey | War scripts e.t.c. included (10/5/2020)

May 10th, 2020, 7:08 pm

Damn this is one sexy guide.
Image
Image


He is wearing a black skin with dark clothes with name off as you can see in the picture during the NIGHT!

Punjabi
Enforcer
Posts: 1401
Game name: Punjabi_Victoriano

Re: (AHK) AutoHotKey | War scripts e.t.c. included (10/5/2020)

May 10th, 2020, 7:16 pm

Newbie.. learn how to on/off the script while being in game :P

Ralph_
Donator
User avatar
Posts: 1833
Game name: Ralph_Toretto, Raphael_TinToretto

Re: (AHK) AutoHotKey | War scripts e.t.c. included (10/5/2020)

May 10th, 2020, 7:43 pm

Punjabi wrote:
May 10th, 2020, 7:16 pm
Newbie.. learn how to on/off the script while being in game :P
like that's some Einstein tier shit to do?
Don’t let your mouth write a cheque that your ass can’t cash.

Schultz
Donator
User avatar
Posts: 34
Game name: Ayden_Russell, Erick_Patterson

Re: (AHK) AutoHotKey | War scripts e.t.c. included (10/5/2020)

May 16th, 2020, 10:54 am

Loved it...CPL Ralph rocks..Aka Mr Aman <3
Image

C-Slo
Donator
Posts: 5115
Game name: Tom_Licata, Lucious_Craig

Re: (AHK) AutoHotKey | War scripts e.t.c. included (10/5/2020)

May 16th, 2020, 1:35 pm

Helper wannabe hhhhh
"If you cannot accept the true I don't find it as mine problem at all."

Report of the decade.


Ralph_
Donator
User avatar
Posts: 1833
Game name: Ralph_Toretto, Raphael_TinToretto

Re: (AHK) AutoHotKey | War scripts e.t.c. included (10/5/2020)

August 14th, 2020, 10:25 pm

-> 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
Don’t let your mouth write a cheque that your ass can’t cash.

C-Slo
Donator
Posts: 5115
Game name: Tom_Licata, Lucious_Craig

Re: (AHK) AutoHotKey | War scripts e.t.c. included (10/5/2020)

August 14th, 2020, 10:40 pm

No thank you
"If you cannot accept the true I don't find it as mine problem at all."

Report of the decade.

Ralph_
Donator
User avatar
Posts: 1833
Game name: Ralph_Toretto, Raphael_TinToretto

Re: (AHK) AutoHotKey | War scripts e.t.c. included (10/5/2020)

January 26th, 2022, 4:45 pm

Bumping this for whoever needs it for the war. Some useful war scripts.
Don’t let your mouth write a cheque that your ass can’t cash.

Return to “Newbie Guides”