SA-MP Batch file
#1

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?
Reply
#2

No-one knows a possible fix? Still looking for any possible help.
Reply
#3

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
Reply
#4

If you execute it in c++, is the batch file in the same folder as sa-mp.exe?
Reply
#5

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
Reply
#6

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.
Reply
#7

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)