SA-MP Forums Archive
Change The name of the server? - 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: Change The name of the server? (/showthread.php?tid=412324)



Change The name of the server? - Saw® - 01.02.2013

Hey , Im only asking if there is a Gamemode code to change the name of the server in SAMP list, (not in Server.cfg but in the gamemode).
thanks.


Re: Change The name of the server? - LarzI - 01.02.2013

Something like this?
pawn Код:
SendRconCommand( "hostname name" );



AW: Change The name of the server? - Blackazur - 01.02.2013

Код:
#define NAME "Servername"
Код:
SendRconCommand("hostname "NAME"");



Re: Change The name of the server? - Saw® - 01.02.2013

Yeah like this , I tried it but doesnt work , what should I write in Server.cfg as hostname?
EDIT: Black : How Can I use it ? I mean , should I change servername or ..?


Re: Change The name of the server? - Saw® - 01.02.2013

Ah ok , tried to put the name of my server in "Servername" but I Get 2 errors once I put the define line , errors : like -bad params and string thing...

Anyone to help me how to use the Rcon command?


Re: Change The name of the server? - ThePhenix - 01.02.2013

PHP код:
stock ChangeServerName(name[])
{
    new 
rconCMD[50];
    
format(rconCMDsizeof(rconCMD), "hostname %s"name);
    return 
SendRconCommand(rconCMD);




AW: Re: Change The name of the server? - Blackazur - 01.02.2013

Quote:
Originally Posted by Saw®
Посмотреть сообщение
Yeah like this , I tried it but doesnt work , what should I write in Server.cfg as hostname?
EDIT: Black : How Can I use it ? I mean , should I change servername or ..?
When you will that your Servername is on your Gamemode, without that you must change it on the server.cfg, then you can.


Re: Change The name of the server? - Saw® - 02.02.2013

To well Understand , I have in server.cfg :

Код:
hostname Los Santos [DM]
and I have a map change system every time the map change I want to write as server name
Код:
hostname Los Santos [DM] [map 1/3]
then next map change it to [mapx/3]...


Re: Change The name of the server? - Mean - 02.02.2013

When the map changes, just do

pawn Код:
SendRconCommand("Los Santos [DM] [map (number)/3]");



Re: Change The name of the server? - Saw® - 02.02.2013

thanks for your repply,Tried it but doesnt work... the hostname in Sa-mp Client stay the written one in Server.CFG