SA-MP Forums Archive
Server name - 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: Server name (/showthread.php?tid=472403)



Server name - DouglasRamirez - 28.10.2013

How to make my server name changes? like - [0.3x]Razer Gaming Roleplay - then after 3-5 seconds it will be - [0.3x l ENG] RGRP is currently hiring - or something like that then after 3-5 seconds again it will be back to the first one, I saw some server with their names blinking or changing. but how?


Re: Server name - HyDrAtIc - 28.10.2013

You'll need to make a timer in OnGameModeInit, have you even tried to use "search"?

There are tons of threads like this, and many tutorials and scripts. :/


Re: Server name - -=Dar[K]Lord=- - 28.10.2013

try this

pawn Код:
new ServerNameLast = 1;

public OnGameModeInit()
{
     SetTimer("UpdateServerName",5000,1);
     return 1;
}
forward UpdateServerName();
public UpdateServerName()
{
      if(ServerNameLast == 1)
      {
            SendRconCommand("hostname [0.3x]Razer Gaming Roleplay");
            ServerNameLast++;
      }
      if(ServerNameLast == 2)
      {
            SendRconcommand("hostname [0.3x l ENG] RGRP is currently hiring");
            ServerNameLast = 1;
      }
      return 1;
}
EDIT: you can extend it too... like you need to extend the " if " statement like

pawn Код:
new ServerNameLast = 1;

public OnGameModeInit()
{
     SetTimer("UpdateServerName",5000,1);
     return 1;
}
forward UpdateServerName();
public UpdateServerName()
{
      if(ServerNameLast == 1)
      {
            SendRconCommand("hostname [0.3x]Razer Gaming Roleplay");
            ServerNameLast++;
      }
      if(ServerNameLast == 2)
      {
            SendRconCommand("hostname [0.3x l ENG] RGRP is currently hiring");
            ServerNameLast++;
      }
      if(ServerNameLast == 3)
      {
            SendRconCommand("hostname new hostname which you want to display");
            ServerNameLast = 1;
      }
      return 1;
}
just set the "ServerNameLast" var to 1 so that the loop continues setting the hostname again and again...

And increment it whenever the hostname arent the last to display..