SA-MP Batch file - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SA-MP Batch file (
/showthread.php?tid=104947)
SA-MP Batch file -
Tannz0rz - 26.10.2009
Hello all, boredom has struck me once again, and I'm making random junk. I don't want to get into any detail, but I'll get to the issue.
As some of you probably have seen, you can use batch files to basically create shortcuts toward connecting to a server, as shown below:
Код:
@echo off
echo Loading SA-MP to connect to server...
samp -h:127.0.0.1 -p:7777 -n:ThisIsMyName
I've conveniently placed it where SAMP is located, and it runs fine when ran manually. Though, when executed through ShellExecute in C++, it doesn't function properly, and gives me this in response: " 'samp' is not recognized as an internal or external command, operable program or batch file."
Anyone have a clue?
Re: SA-MP Batch file -
Tannz0rz - 27.10.2009
No-one knows a possible fix? Still looking for any possible help.
Re: SA-MP Batch file -
dice7 - 27.10.2009
This has no connection to samp what so ever. Go on a C forum or something.
And the error occurs because the path to the batch has spaces
Re: SA-MP Batch file -
ғαιιοцт - 27.10.2009
If you execute it in c++, is the batch file in the same folder as sa-mp.exe?
Re: SA-MP Batch file -
Streetplaya - 27.10.2009
Starting the samp.exe is not the best way to archieve this, I suggest starting GTA-SA via CreateProcess and
then inject samp.dll. This is how the sa-mp browser is originally doing that
Re: SA-MP Batch file -
Tannz0rz - 27.10.2009
Quote:
Originally Posted by °ғαιιοцт°
If you execute it in c++, is the batch file in the same folder as sa-mp.exe?
|
Yes. The weird thing is that it should work, even through ShellExecute, yet it doesn't.
Quote:
Originally Posted by !MaVe
Starting the samp.exe is not the best way to archieve this, I suggest starting GTA-SA via CreateProcess and
then inject samp.dll. This is how the sa-mp browser is originally doing that
|
I suppose I could give that a try.
Re: SA-MP Batch file -
Streetplaya - 28.10.2009
Quote:
Originally Posted by Tannz0rz
I suppose I could give that a try.
|
PM me if you need a library injection function or some other stuff.