changing hostname automatic
#1

Hi i want my hostname change every 1 min i made the timer and forwarded it but i cant find the right function to change it if you know it please tell me and if it with file functions please tell me how to do it ?
Reply
#2

you can use SetGameModeText to change the game mode text

https://sampwiki.blast.hk/wiki/SetGameModeText
Reply
#3

Disregard this, first post answered it.
Reply
#4

pawn Код:
//ongamemodeinit
SetTimer("GMname", 60000, true); // Makes a timer that repeats every minute

forward GMname() // forwards the timer

public GMname()
{  
    new rand = random(5); // gets a random number
    switch(rand) // switches through the numbers
    {
        case 0: SetGameModeText("Las Venturas: a"); // if random == 0, then GMname is this
        case 1: SetGameModeText("Las Venturas: b"); // if random == 1, then GMname is this
        case 2: SetGameModeText("Las Venturas: c"); // etc
        case 3: SetGameModeText("Las Venturas: d"); // etc
        case 4: SetGameModeText("Las Venturas: e"); // etc
        cas3 5: SetGameModeText("Las Venturas: f"); // etc
    }
    return 1;
}
This should work
Reply
#5

no
pawn Код:
cas3 5: SetGameModeText("Las Venturas: f"); // etc
its work
pawn Код:
case 5: SetGameModeText("Las Venturas: f");
Reply
#6

Just a typo and didnt notice, my bad. But its just an example to show him how it works
Reply
#7

Not game mode text the host name text i mean the server name you set from server.cfg
Reply
#8

Quote:
Originally Posted by marwan
Посмотреть сообщение
Not game mode text the host name text i mean the server name you set from server.cfg
I believe that is done the same way, no?

Код:
hostname My Hostname
would be the same as

Код:
SetGameModeText("My Hostname");
Reply
#9

And otherwise change them with
pawn Код:
SendRconCommand("hostname My hostname here");
Worth a try, note sure if it works
Reply
#10

Код:
#include <a_samp>
#define FILTERSCRIPT
forward hostname();
forward hostname2();
#define hostnamechangetime 3000 // Change "3000" to the value how often the hostname is changed, 1000 = 1 second

//----------------------------------------------------------------------------

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print("AutoHostname");
	print("--------------------------------------\n");
	SetTimer("hostname", 3000, 0);/settimer 3000,to 1000 = 1 second
	return 1;
}

//----------------------------------------------------------------------------
public hostname()
{
      SendRconCommand("hostname verision 1.6");//modify the name server don't remove hostname
      SetTimer("hostname", hostnamechangetime, 0);//settimer hostname
      return 1;
}
public hostname2()
{
      SendRconCommand("hostname lets go counter strike ");//modify the name server don't remove hostname
      SetTimer("hostname2", hostnamechangetime, 0);//settimer hostname2
      return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)