How to make Moving Host 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to make Moving Host Name? (
/showthread.php?tid=127887)
How to make Moving Host Name? -
[WSM]Deadly_Evil - 15.02.2010
I have seen servers like GamerX server the host name change after 5 min to "GamerX [Euro] 0.3 Visit
www.sa-mp.com" and sometimes "GamerX [Euro] 0.3 Fun Fun Fun"
How i can make like this with this: SendRconCommand("hostname [0.3] blabla Fun Fun Fun");
Any ideas guys?
Re: How to make Moving Host Name? -
Correlli - 15.02.2010
Use SendRconCommand function in a timer.
Re: How to make Moving Host Name? -
[WSM]Deadly_Evil - 15.02.2010
Like this??:
Not Tested i am still learning Pawno
pawn Code:
forward HostName();
SetTimer("HostName",100000,true);
new HostName;
public HostName()
{
switch (HostName)
{
case 0: {SendRconCommand("hostname [0.3] blabla Fun Fun Fun");} // first message
case 1: {SendRconCommand("hostname [0.3] blabla Stunting Server!");}
case 2: {SendRconCommand("hostname [0.3] blabla Free Roam Also :P");}
}
return 1;
}
Re: How to make Moving Host Name? -
Correlli - 15.02.2010
You can't have the variable with the same name as the function (HostName) and you don't need those brackets at the switch cases.
Use a random function.
Re: How to make Moving Host Name? -
[WSM]Deadly_Evil - 15.02.2010
Oh i just remove (HostName) and new HostName;

Please give me the correct code

So i can understand it
Re: How to make Moving Host Name? -
Correlli - 15.02.2010
pawn Code:
forward myTimer();
// under OnGameModeInit/OnFilterScriptInit-callback.
SetTimer("myTimer", 100000, true); // repeating every 100 seconds.
public myTimer()
{
new
myMsg = random(3);
switch(myMsg)
{
case 0: SendRconCommand("hostname message 1");
case 1: SendRconCommand("hostname message 2");
case 2: SendRconCommand("hostname message 3");
}
return true;
}
Re: How to make Moving Host Name? -
[WSM]Deadly_Evil - 15.02.2010
Thanks
Re: How to make Moving Host Name? -
Correlli - 15.02.2010
You're welcome.