SA-MP Forums Archive
C# Help - 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)
+--- Thread: C# Help (/showthread.php?tid=451220)



C# Help - Salim_Karaja - 16.07.2013

Im trying to launch samp from client that I've build but im facing a problem,
Its connecting to the ip that im typing, but port is always 7777, code:

Код:
ProcessStartInfo startInfo = new ProcessStartInfo("C://Program Files/Rockstar Games/GTA San Andreas/samp.exe");
            startInfo.Arguments = "-c -h127.0.0.1 -n 5665";
            Process.Start(startInfo);
So basiclly its launching samp with the following ip:
127.0.0.1:7777


Re: C# Help - MP2 - 16.07.2013

-n is name not port.

Quote:

-c rcon_password
-n player name
-h server ip (host)
-p server port
-z server password

example:" -c -n Mohsen -h 91.184.76.104 -p 1223"

Not sure if -c is required?


Re: C# Help - ReVo_ - 16.07.2013

Код:
startInfo.Arguments = "-h 127.0.0.1 -p 5665";
Remove -c if you dont use it.

Try this


Re: C# Help - Salim_Karaja - 16.07.2013

Quote:
Originally Posted by MP2
Посмотреть сообщение
-n is name not port.


Not sure if -c is required?
i tried the example and it didnt worked
:7777


Re: C# Help - Salim_Karaja - 16.07.2013

Quote:
Originally Posted by ReVo_
Посмотреть сообщение
Код:
startInfo.Arguments = "-h 127.0.0.1 -p 5665";
Remove -c if you dont use it.

Try this
sorry for double but its not working


Re: C# Help - ReVo_ - 16.07.2013

The code is correct.

Maybe you need something like this:
https://github.com/Zeex/samp-server-cli

and maybe sa-mp server dont have any command-line feature (just read server.cfg)

@MP2: Where you taked commands?


Re: C# Help - MP2 - 16.07.2013

Quote:
Originally Posted by ReVo_
Посмотреть сообщение
@MP2: Where you taked commands?
Where did I find the list? I ******d 'samp.exe params' lol

Weird what Kye says though..

Quote:
Originally Posted by Kalcor
Посмотреть сообщение
There are no command line params you can send to samp.exe at the moment. The only command line params that exist are those sent to gta_sa.exe from samp.exe, which are 'read only'.
Is that not true?


Re: C# Help - Salim_Karaja - 16.07.2013

Fixed, how simple:
Код:
ProcessStartInfo startInfo = new ProcessStartInfo("C://Program Files/Rockstar Games/GTA San Andreas/samp.exe");
            startInfo.Arguments = "127.0.0.1:5665";
            Process.Start(startInfo);