привязка плагина

Диман Антипов

Всегда онлайн
Сообщения
10
Реакции
0
Ребят, привет подскажите как правильно привязать плагин
HTML:
public OnPluginStart()  
{  
      ////////////////////////////////////////////////////////  

      // на каком должен работать  
      new const String:IP_PORT[] = "1.2.3.4:27015";  

      /////////  

      new Handle:h_IP = FindConVar("hostip");  
      new Handle:h_PORT = FindConVar("hostport");  

      if (h_IP == INVALID_HANDLE || h_PORT == INVALID_HANDLE)  
      {  
          SetFailState("h_IP || h_PORT == INVALID_HANDLE");  
          return;  
      }  

      new hostip = GetConVarInt(h_IP);  
      new ip1 = hostip >>> 24 & 255;  
      new ip2 = hostip >>> 16 & 255;  
      new ip3 = hostip >>> 8 & 255;  
      new ip4 = hostip & 255;  

      decl String:current_ip_port[75];  
      Format(current_ip_port, 75, "%d.%d.%d.%d:%d", ip1, ip2, ip3, ip4, GetConVarInt(h_PORT));  
      if (strcmp(current_ip_port, IP_PORT, false) != 0)  
      {  
          SetFailState("\nYour server: %s. Plugin for: %s", current_ip_port, IP_PORT);  
      }  

      ////////////////////////////////////////////////////////  
}
 

R1KO

fuck society
Сообщения
9,457
Реакции
7,786
  • Команда форума
  • #2
PHP:
#define IP_PORT "1.2.3.4:27015"  // на каком должен работать  

public OnPluginStart()  
{
	new hostip = GetConVarInt(FindConVar("hostip"));  

	decl String:current_ip_port[75];  
	FormatEx(current_ip_port, 75, "%d.%d.%d.%d:%d", (hostip >>> 24 & 255), (hostip >>> 16 & 255), (hostip >>> 8 & 255), (hostip & 255), GetConVarInt(FindConVar("hostport")));  
	if (strcmp(current_ip_port, IP_PORT, false) != 0)  
	{  
		SetFailState("\nYour server: %s. Plugin for: %s", current_ip_port, IP_PORT);  
	}  
}


Но её очень легко обойти
 

Диман Антипов

Всегда онлайн
Сообщения
10
Реакции
0
PHP:
#define IP_PORT "1.2.3.4:27015"  // на каком должен работать  

public OnPluginStart()  
{
	new hostip = GetConVarInt(FindConVar("hostip"));  

	decl String:current_ip_port[75];  
	FormatEx(current_ip_port, 75, "%d.%d.%d.%d:%d", (hostip >>> 24 & 255), (hostip >>> 16 & 255), (hostip >>> 8 & 255), (hostip & 255), GetConVarInt(FindConVar("hostport")));  
	if (strcmp(current_ip_port, IP_PORT, false) != 0)  
	{  
		SetFailState("\nYour server: %s. Plugin for: %s", current_ip_port, IP_PORT);  
	}  
}


Но её очень легко обойти

как
 
Сверху Снизу