What's new

[GUIDE] RCRP desktop shortcut

Cain

Silver Member
Joined
May 12, 2013
Messages
1,224
Looks great!

Is it possible to set the shortcut to open your Autohotkey bind along with the SAMP?
 

Cheesy

Gold Member
Joined
Jun 1, 2012
Messages
2,137
Location
Sweden
Cain said:
Looks great!

Is it possible to set the shortcut to open your Autohotkey bind along with the SAMP?

Absolutely. I made this guide covering that exact subject two years ago, although I can't really recommend it since my writing was awful.

Anyways, you can do this using a batch file. Write in a new empty text document:

Code:
@echo off
cd *GTA SA main directory e.g C:\Program Files (x86)\Rockstar Games\GTA San Andreas\*
start samp.exe 188.165.139.152:7777
cd *Script directory e.g. C:\Users\*My name*\Documents\GTA San Andreas User Files\*
start *Full script filename e.g. RedCountyRoleplay.ahk*
Change the stuff in asterisks (**) to fit you. Now save the file as a batch, click "Save As" and make sure the file name ends with ".bat". This works if you've compiled your script too, just change .ahk to .exe in the batch file.

You can also automate the closing of the script when you quit the game. Add this near the top of your AutoHotkey script:
Code:
loop {
		sleep 6000
		IfWinNotExist, ahk_class Grand theft auto San Andreas
		{
			ExitApp
		}
	}

See if it works for you, otherwise just leave a reply and I'll write/do something more thoroughly. :thumbup:
 

Cain

Silver Member
Joined
May 12, 2013
Messages
1,224
I'm having a bit trouble running samp.exe, I'm getting an error "Windows cannot find 'samp.exe'. Make sure you typed the name correctly, and then try again." The AHK script runs without any issues though. Could it be because of the location of the samp file? My San Andreas directory is F:\Program Files (x86)\Rockstar Games\GTA San Andreas\
 

Cheesy

Gold Member
Joined
Jun 1, 2012
Messages
2,137
Location
Sweden
Cain said:
I'm having a bit trouble running samp.exe, I'm getting an error "Windows cannot find 'samp.exe'. Make sure you typed the name correctly, and then try again." The AHK script runs without any issues though. Could it be because of the location of the samp file? My San Andreas directory is F:\Program Files (x86)\Rockstar Games\GTA San Andreas\

Try this instead, I just checked and I actually do it in a different way in my own bat. (sry) I think it's passing the ip that screws it up, but this should work:

Code:
@echo off
start "" "C:\Program Files (x86)\Rockstar Games\GTA San Andreas\samp.exe" "188.165.139.152:7777"
start "" "C:\Users\*Name*\Documents\SAMP\AHK\script.ahk"
exit
Of course change the script and program directory as you need. :cowboy:
 

Cain

Silver Member
Joined
May 12, 2013
Messages
1,224
That worked like a charm! Thanks man, you're really good at this stuff! :)
 
Top