Posts: 596
Threads: 75
Joined: Nov 2015
Hi,i made a function which automatically adds tag to server hostname if its hosted on ip *,but there is a problem that if the variable "bind" is not in the server.cfg,it adds the server tag in that case too,anyone knows a fix for that?
Код:
if(!strcmp(GetServerIP(), "***.***.***.***", false))
{
SendRconCommand("hostname "HOSTNAME" "HOSTNAME_TAG"");
}
else
{
SendRconCommand("hostname "HOSTNAME"");
}
Posts: 596
Threads: 75
Joined: Nov 2015
Posts: 262
Threads: 51
Joined: May 2014
Reputation:
0
Try That forward ChangeHostNameUpdate();
public ChangeHostnameUpdate()
{
SetTimer("hostname",3000,1);
(1000 = 100 second)
return 1;
}
new var = random(4);
switch (var)
{
case 0: SendRconCommand("hostname [Hostname]");
case 1: SendRconCommand("hostname [Hostname]");
case 2: SendRconCommand("hostname [Hostname]");
}
Posts: 596
Threads: 75
Joined: Nov 2015
The tag is working properly,but im asking to remove the tag if the "bind" is not defined in server.cfg
Posts: 596
Threads: 75
Joined: Nov 2015
Quote:
Originally Posted by Threshold
pawn Код:
new string[16]; GetConsoleVarAsString("bind", string, sizeof(string)); if(string[0] == EOS) { // There is no 'bind' or 'bind' is null. } else { // There is a 'bind' in server.cfg (or has been set in console) }
|
Can i use GetServerVarAsString?