[FS/SNIPPET] Advanced mapname and hostname changer -
Striker_Moe - 26.09.2009
|| Advanced mapname and hostname changer ||
Whatґs this FS about?
This filterscript / snippet changes your hostname and/or mapname in a free definable time. You can enter 2 hostnames and mapnames which will be shown up after each other, somebody described it as "flashing".
Spotted a bug?
Although Iґve tested everything, bugs can emerge. If you spot one, please report it in this thread!
Credits & Copyright
- Credits to me
- You may edit this script if you want to, but you may not re-upload it then.
Download:
.pwn (No amx, you know why
)
Pastebin(.com):
http://pastebin.com/f35aea406
Have fun playing SA:MP.
Re: [FS/SNIPPET] Advanced mapname and hostname changer -
[XST]O_x - 26.09.2009
Wow nice
Re: [FS/SNIPPET] Advanced mapname and hostname changer -
Correlli - 26.09.2009
There's an mistake:
Quote:
Code:
public hostname()
{
SendRconCommand("mapname [YOUR FIRST HOSTNAME HERE]");
SetTimer("hostname", hostnamechangetime, 0);
return 1;
}
public hostname2()
{
SendRconCommand("mapname [YOUR SECOND HOSTNAME HERE]~ ");
SetTimer("hostname2", hostnamechangetime, 0);
return 1;
}
|
I suppose you wanted to change hostname, not mapname.
Use "hostname" rcon-command to change hostname.
And also, there's no need for four timers, you can have it in two timers.
Re: [FS/SNIPPET] Advanced mapname and hostname changer -
Striker_Moe - 26.09.2009
Fixed, thank you.
Re: [FS/SNIPPET] Advanced mapname and hostname changer -
Ozz - 18.10.2009
lol why are you using strtok together with dcmd? I thought dcmd n that stuff was made so you wouldnt have to use strtok..
Re: [FS/SNIPPET] Advanced mapname and hostname changer -
RyDeR` - 18.10.2009
You could use #define to define hostnames..
Re: [FS/SNIPPET] Advanced mapname and hostname changer -
Tenshi - 19.03.2010
You made a mistake in 1 of your timers, and made your code smaller:
Update:
http://sa-mp.com.pastebin.com/CNw3jdfQ
pawn Code:
#include <a_samp>
#define FILTERSCRIPT
//
forward mapname(); forward mapname2(); forward hostname(); forward hostname2();
//
#define mapnamechangetime 3000 // Change "3000" to the value how often the mapname is changed, 1000 = 1 second
#define hostnamechangetime 3000 // Change "3000" to the value how often the hostname is changed, 1000 = 1 second
//
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Advanced mapname and hostname changer ");
print(" By Mo3 aka TheFailFactor");
print("--------------------------------------\n");
SetTimer("mapname", 3000, 0);
SetTimer("hostname", 3000, 0);
return 1;
}
/* --- map name 1 --- */
public mapname() { SendRconCommand("mapname MAPNAME #1"); return SetTimer("mapname2", mapnamechangetime, 0); }
/* --- map name 2 --- */
public mapname2(){ SendRconCommand("mapname MAPNAME #2"); return SetTimer("mapname", mapnamechangetime, 0); }
/* --- host name --- */
public hostname(){ SendRconCommand("hostname HOSTNAME #1"); return SetTimer("hostname2", hostnamechangetime, 0); }
/* --- host name 2 --- */
public hostname2(){ SendRconCommand("hostname HOSTNAME #2"); return SetTimer("hostname", hostnamechangetime, 0); }
Re: [FS/SNIPPET] Advanced mapname and hostname changer -
Kyosaur - 19.03.2010
Terrible
. Use an array to store the strings instead of making separate functions.
Re: [FS/SNIPPET] Advanced mapname and hostname changer -
sushihusi - 19.03.2010
nice
Re: [FS/SNIPPET] Advanced mapname and hostname changer -
scatalin12 - 20.03.2010
thx
Re: [FS/SNIPPET] Advanced mapname and hostname changer -
hab2ever - 21.03.2010
nice but simple:
new hn;//global variable
//Under ongamemodeinit
SetTimer("changehost", 3000,1); // it will change the server name after every 3 seconds
forward changehost();
public changehost()
{
switch(hn)
{
case 0:
{
SendRconCommand("hostname the name u want");
hn++;
}
case 1:
{
SendRconCommand("hostname the name u want");
hn++;
}
case 2:
{
SendRconCommand("hostname the name u want");
hn = 0;
}
}
return 1;
}
Re: [FS/SNIPPET] Advanced mapname and hostname changer -
[MWR]Blood - 28.03.2010
Very nice!
Re: [FS/SNIPPET] Advanced mapname and hostname changer -
SkyWinder - 28.03.2010
Nice Job
Re: [FS/SNIPPET] Advanced mapname and hostname changer -
FLoRyN[RO] - 11.06.2010
Downloaded, tested, some bugs:
This doesn't work, simple just chage one time the hostname not evry 3 seconds how should be, and mapname doesn't change:
And this changes the hostnames but the mapname nope.....:
Quote:
Originally Posted by Tenshi
You made a mistake in 1 of your timers, and made your code smaller:
Update: http://sa-mp.com.pastebin.com/CNw3jdfQ
pawn Код:
#include <a_samp> #define FILTERSCRIPT // forward mapname(); forward mapname2(); forward hostname(); forward hostname2(); // #define mapnamechangetime 3000 // Change "3000" to the value how often the mapname is changed, 1000 = 1 second #define hostnamechangetime 3000 // Change "3000" to the value how often the hostname is changed, 1000 = 1 second // public OnFilterScriptInit() { print("\n--------------------------------------"); print(" Advanced mapname and hostname changer "); print(" By Mo3 aka TheFailFactor"); print("--------------------------------------\n"); SetTimer("mapname", 3000, 0); SetTimer("hostname", 3000, 0); return 1; } /* --- map name 1 --- */ public mapname() { SendRconCommand("mapname MAPNAME #1"); return SetTimer("mapname2", mapnamechangetime, 0); } /* --- map name 2 --- */ public mapname2(){ SendRconCommand("mapname MAPNAME #2"); return SetTimer("mapname", mapnamechangetime, 0); } /* --- host name --- */ public hostname(){ SendRconCommand("hostname HOSTNAME #1"); return SetTimer("hostname2", hostnamechangetime, 0); } /* --- host name 2 --- */ public hostname2(){ SendRconCommand("hostname HOSTNAME #2"); return SetTimer("hostname", hostnamechangetime, 0); }
|
Can you rezolve it?