[FS/SNIPPET] Advanced mapname and hostname changer
#1

|| 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.
Reply
#2

Wow nice
Reply
#3

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.
Reply
#4

Fixed, thank you.
Reply
#5

lol why are you using strtok together with dcmd? I thought dcmd n that stuff was made so you wouldnt have to use strtok..
Reply
#6

You could use #define to define hostnames..
Reply
#7

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); }
Reply
#8

Terrible . Use an array to store the strings instead of making separate functions.
Reply
#9

nice
Reply
#10

thx
Reply
#11

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;
}
Reply
#12

Very nice!
Reply
#13

Nice Job
Reply
#14

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:


Quote:
Originally Posted by Mo3
Download:

.pwn (No amx, you know why )


Pastebin(.com):
http://pastebin.com/f35aea406

Have fun playing SA:MP.
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?

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)