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)
+--- Thread: Hostname (
/showthread.php?tid=507575)
Hostname -
ChristianIvann09 - 18.04.2014
Hello, Good Day helpers!
How can i make a code that can change the host name in every 5 or 3 seconds.
For Example:
[PH] Philippines Roleplay [ALL ACCOUNTS RESETED]
every 3 second/5 second it will change to this
[PH] Philippines Roleplay [0.3z]
it will repeat. it will loop
how?
Thanks!
Re: Hostname -
Xeinss - 18.04.2014
SetTimer("Hostname",5*1000*60,1);
forward Hostname(playerid);
public Hostname(playerid)
{
SendRconCommand("hostname "ServerName"");
return 1;
}
Re: Hostname -
ChristianIvann09 - 19.04.2014
Quote:
Originally Posted by Xeinss
SetTimer("Hostname",5*1000*60,1);
forward Hostname(playerid);
public Hostname(playerid)
{
SendRconCommand("hostname "ServerName"");
return 1;
}
|
Its not working
Re: Hostname -
luis_mendoza - 19.04.2014
pawn Код:
forward Hostname();
public Hostname()
{
new rnd = random(3);
switch (rnd)
{
case 0: SendRconCommand("hostname [PH] Philippines Roleplay [ALL ACCOUNTS RESETED]");
case 1: SendRconCommand("hostname [PH] Philippines Roleplay [0.3z]");
case 2: SendRconCommand("hostname [PH] Philippines Roleplay [SOMETHING]");
}
}
public OnGameModeInit()
{
SetTimer("Hostname",3000,1); // EVERY 3 SEC IT CHANGES
return 1;
}
Re: Hostname -
ChandraLouis - 19.04.2014
Try this on
pawn Код:
#include <a_samp>
forward hostname();
public hostname()
{
new Rand = random(3); // Change it if you added "case 2: SendRconCommand("hostname [PH] Philippines Roleplay [Join Us !]");"
switch (Rand)
{
case 0: SendRconCommand("hostname [PH] Philippines Roleplay [Re-Setting All Accounts]");
case 1: SendRconCommand("hostname [PH] Philippines Roleplay [0.3z Version]");
case 2: SendRconCommand("hostname [PH] Philippines Roleplay [Join Us !]");
// You can add more here just copying the code above and edit the "[PH] Philippines Roleplay [Join Us !]" //
// Remember dont remove the "hostname" //
}
}
public OnFilterScriptInit() // You can change this to OnGameModeInIt
{
SetTimer("hostname",3000,1); // 3000 = 3 Seconds you can change it if you want 5 Seconds = 5000
return 1;
}
Re: Hostname -
Flake. - 19.04.2014
Quote:
Originally Posted by ChandraLouis
Try this on
pawn Код:
#include <a_samp> forward hostname(); public hostname() { new Rand = random(5); switch (Rand) { case 0: SendRconCommand("hostname [PH] Philippines Roleplay [ALL ACCOUNTS RESETED]"); case 1: SendRconCommand("hostname [PH] Philippines Roleplay [0.3z Version]"); case 2: SendRconCommand("hostname [PH] Philippines Roleplay [Join Us !]"); // You can add more here just copying the code above and edit the "[PH] Philippines Roleplay [Join Us !]" // // Remember dont remove the "hostname" // } } public OnFilterScriptInit() // You can change this to OnGameModeInIt { SetTimer("hostname",3000,1); // 3000 = 3 Seconds you can change it if you want 5 Seconds = 5000 return 1; }
|
You've defined random as using 5 cases when it's only using 3, might as well change that. Also @OP 'Reseted' isn't a word.
Re: Hostname -
ChandraLouis - 19.04.2014
Quote:
Originally Posted by (*|Flake|*)
You've defined random as using 5 cases when it's only using 3, might as well change that. Also @OP 'Reseted' isn't a word. 
|
Oh sorry i dont notice it
Re: Hostname - Astralis - 19.04.2014
https://sampforum.blast.hk/showthread.php?tid=273353