SA-MP Forums Archive
Auto change HostName - 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: Auto change HostName (/showthread.php?tid=57446)



Auto change HostName - super-sergio16 - 07.12.2008

I have seen some server, it changes the HostName each 5seg, how can I do this for my server?


Re: Auto change HostName - Tez2k7 - 07.12.2008

SendRconCommand("hostname ChangeThis");

Totally untested btw, not sure if it will even work.


Re: Auto change HostName - Lewwy - 07.12.2008

Tez just go and play Roller Coaster Tycoon, you obviously suck at SA-MP.

You can use this as a filterscript if you want, else just change things around for it to be in gamemode format:

pawn Code:
// above main()
forward ChangeHostname();

public OnFilterScriptInit()
{
   SetTimer("ChangeHostname",1000,1); // Change the, 1000 to whatever you want, in milliseconds ofc.
   return 1;
}

public ChangeHostname()
{
   new var = random(3);
   switch (var)
   {
     case 0: SendRconCommand("hostname My server name 1");
     case 1: SendRconCommand("hostname Server name 2");
     case 2: SendRconCommand("hostname Name 3 here");
   }
}



Re: Auto change HostName - super-sergio16 - 07.12.2008

Quote:
Originally Posted by •Lj•
Tez just go and play Roller Coaster Tycoon, you obviously suck at SA-MP.

You can use this as a filterscript if you want, else just change things around for it to be in gamemode format:

pawn Code:
// above main()
forward ChangeHostname();

public OnFilterScriptInit()
{
  SetTimer("ChangeHostname",1000,1); // Change the, 1000 to whatever you want, in milliseconds ofc.
  return 1;
}

public ChangeHostname()
{
  new var = random(3);
  switch (var)
  {
    case 0: SendRconCommand("hostname My server name 1");
    case 1: SendRconCommand("hostname Server name 2");
    case 2: SendRconCommand("hostname Name 3 here");
  }
}
It gives me a mistake to form the filterscript, I can spend longer in .pwn?


Re: Auto change HostName - Lewwy - 07.12.2008

Can you show me what it says?


Re: Auto change HostName - Tez2k7 - 07.12.2008

Quote:
Originally Posted by •Lj•
Tez just go and play Roller Coaster Tycoon, you obviously suck at SA-MP.

You can use this as a filterscript if you want, else just change things around for it to be in gamemode format:

pawn Code:
// above main()
forward ChangeHostname();

public OnFilterScriptInit()
{
  SetTimer("ChangeHostname",1000,1); // Change the, 1000 to whatever you want, in milliseconds ofc.
  return 1;
}

public ChangeHostname()
{
  new var = random(3);
  switch (var)
  {
    case 0: SendRconCommand("hostname My server name 1");
    case 1: SendRconCommand("hostname Server name 2");
    case 2: SendRconCommand("hostname Name 3 here");
  }
}
That's what I did but 10times as complicated!


Re: Auto change HostName - punisher0000 - 04.01.2011

Nice it work's


Re: Auto change HostName - admantis - 04.01.2011

Quote:
Originally Posted by Tez2k7
View Post
That's what I did but 10times as complicated!
You obviously haven't realized that your code will set the hostname once, and only a static hostname.

What he does will set the hostname to various names, and repeat it.