Posts: 621
Threads: 174
Joined: Nov 2013
how to set this
evey 5 seconds the host name will change and come back again
for example: American Streets Roleplay[All Bugs Fixed]
after 5 seconds
American Streets Roleplay[All Accounts Reseted]
after 5 seconds
American Streets Roleplay[All Bugs Fixed]
and it will loop.
how?
Posts: 181
Threads: 2
Joined: Feb 2014
Reputation:
0
Do it scriptwise. Set a timer after which the script changes the hostname.
Posts: 498
Threads: 24
Joined: Apr 2013
At the top of your script :
PHP код:
new namechanged = 0;
forward ChangingName();
in OnGameModeInit :
PHP код:
SetTimer("ChangingName" , 5000 , 1);
any where you want :
PHP код:
public ChangingName()
{
if(namechanged == 1)
{
SendRconCommand("hostname your first server name"); // like "hostname American Streets Roleplay[All Bugs Fixed]"
namechanged = 0;
}
if(namechanged == 0)
{
SendRconCommand("hostname your second server name"); // like "hostname American Streets Roleplay[All Accounts Reseted]"
namechanged = 1;
}
return 1;
}
Posts: 621
Threads: 174
Joined: Nov 2013
Quote:
Originally Posted by Emmet_
The best way is to do this:
pawn Код:
static const g_aServerNames[][64] = { {"American Streets Roleplay[All Bugs Fixed]"}, {"American Streets Roleplay[All Accounts Reseted]"} };
public OnGameModeInit() { SetTimer("OnHostnameChange", 5000, true); }
forward OnHostnameChange(); public OnHostnameChange() { static index, str[64];
if (index == sizeof(g_aServerNames) - 1) index = 0;
format(str, sizeof(str), "hostname %s", g_aServerNames[index++]); SendRconCommand(str); }
|
THAANK YOUU!!