Server name change
#1

How to change the server name every 4 seconds? I saw that on a server and i want to do that , if you can help me i will rep you
Reply
#2

First result in ******: https://sampforum.blast.hk/showthread.php?tid=206426
Reply
#3

That tutorial is wrong maked
that " don't have to be there
pawn Код:
format(str, sizeof(str), "hostname %s", HName1");
and also here
pawn Код:
format(str, sizeof(str), "hostname %s", HName2");

Just a little bit easy
pawn Код:
#include <a_samp>

#define S_NAME1 "Modify Here"
#define S_NAME 2 "Modify Here"
#define S_NAME 3 "Modufy Here"

#define TIMER_CHANGE 4000

public OnGameModeInit()
{
    SetTimer("SetNameServer", TIMER_CHANGE , true);
    return 1;
}

forward SetNameServer();
public SetNameServer()
{
    new r = random(3)
    switch(r)
    {
        case 0:
        {
            new str[128];
            format(str, sizeof(str), "hostname %s", S_NAME1);
            SendRconCommand(str);
           
        }
        case 1:
        {
            new str[128];
            format(str, sizeof(str), "hostname %s", S_NAME1);
            SendRconCommand(str);
        }
        case 2:
        {
            new str[128];
            format(str, sizeof(str), "hostname %s", S_NAME1);
            SendRconCommand(str);
        }
    }
}
Reply
#4

I will try it out first then if it works i will +rep you
Reply
#5

Error Expteced token in this
switch®
Reply
#6

pawn Код:
new r = random(3);
Missing semicolon
Reply
#7

Must be:
pawn Код:
new r = random(3);
I was so unfucused there... I wrote "switch®;"
Eh:
Код:
This forum requires that you wait 120 seconds between posts. Please try again in 13 seconds.
Edit: LOL Misiur posted before me...
Reply
#8

Fixed, I will test the system now if works = +repd
@Dragonsaurus

Wrong , I should fix new® = random; not switch® , btw thanks
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)