17/09/2023 01:57 
(Esta mensagem foi modificada pela última vez a: 10/12/2024 04:25 por Cifra Modder.)
	
	
	
		Venho trazer hoje um script bastante pedido no samp, e que vai ajudar na maioria dos servidor samp! Tá cansado de banir um player pelo IP e o mesmo voltar? Bom tenho uma solução para você que vai corrigir 80% disso.
Esse script que eu trago se chama anti vpn como o título já diz, ele contém 2 verificação, 1 quando o player spawna, outra quando o player conecta,
Quando o player spawna ele vai fazer uma verificação média, se caso o player tiver com vpn e não for detectado pela Api, quando o player spawnar aí ter outra verificação, nessa verificação é mais rígida, e conserteza vai pegar o player que está usando Vpn/Proxy.
Versão Samp (Testada):
Versão Open.MP (Não testada):
	
	
	
	
Esse script que eu trago se chama anti vpn como o título já diz, ele contém 2 verificação, 1 quando o player spawna, outra quando o player conecta,
Quando o player spawna ele vai fazer uma verificação média, se caso o player tiver com vpn e não for detectado pela Api, quando o player spawnar aí ter outra verificação, nessa verificação é mais rígida, e conserteza vai pegar o player que está usando Vpn/Proxy.
Versão Samp (Testada):
Código:
//Anti vpn/proxy
#define FILTERSCRIPT
#include <a_samp>
#include <a_http>
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print("        Anti Vpn por: Cifra Modder      ");
    print("--------------------------------------\n");
    return 1;
}
public OnFilterScriptExit()
{
    return 1;
}
forward MyHttpResponse(playerid, response_code, data[]);
public OnPlayerConnect(playerid)
{
    new ip[16], string[59];
    GetPlayerIp(playerid, ip, sizeof ip);
    format(string, sizeof string, "proxycheck.io/v2/%s?vpn=2&asn=2", ip); //API
    HTTP(playerid, HTTP_GET, string, "", "MyHttpResponse");
    return 1;
}
stock bool:StrContains(const source[], const find[])
{
    new source_len = strlen(source);
    new find_len = strlen(find);
    for (new i = 0; i <= source_len - find_len; i++)
    {
        new match = true;
        for (new j = 0; j < find_len; j++)
        {
            if (source[i + j] != find[j])
            {
                match = false;
                break;
            }
        }
        if (match)
            return true;
    }
    return false;
}
public MyHttpResponse(playerid, response_code, data[])
{
    new name[MAX_PLAYERS],string[256];
    new ip[16];
    GetPlayerName(playerid, name, sizeof(name));
    GetPlayerIp(playerid, ip, sizeof ip);
    if(strcmp(ip, "127.0.0.1", true) == 0)
    {
        format(string, 256, "[LOCALHOST] %s(%d) se conectou no servidor - LocalHost.", name, playerid);
        SendClientMessageToAll( 0x09F7DFC8, string);
        return 1;
    }
    if(response_code == 200)
    {    
        if (StrContains(data, "\"proxy\": \"yes\""))
        {
            format(string, 256, "[ANTI-VPN] %s(%d) foi kickado por suspeita de Vpn/Proxy.", name, playerid);
            SendClientMessageToAll( 0xFF0000FF, string); //AQUI VOCE PODE COLOCAR O SISTEMA PRA ENVIAR A MENSAGEM PROS ADMINS ONLINE.
            Kick(playerid); //AQUI VOCE VER QUAL PUNIÇÃO VAI DAR PRO PLAYER
        }
        if (StrContains(data, "\"proxy\": \"no\"")) //VOCÊ PODE REMOVER ISSO SE QUISER
        {
            format(string, 256, "[ANTI-VPN] %s(%d) nao foi detectado Proxy/Vpn. Jogador conectado!.", name, playerid);
            SendClientMessageToAll( 0x09F7DFC8, string );
        }
    }
    return 1;
}
#endifVersão Open.MP (Não testada):
Código:
// Versao open mp atualizado - 29/8/2024
#include <open.mp>
public OnFilterScriptInit()
{
    print("sistema Anti vpn/proxy iniciado");
    return 1;
}
public OnFilterScriptExit()
{
    return 1;
}
public OnPlayerConnect(playerid)
{
    DetectionVpn(playerid)
    return 1;
}
stock DetectionVpn(playerid)
{
    new string[120];
    GetPlayerIp(playerid, ip, sizeof ip);
    format(string, sizeof string, "proxycheck.io/v2/%s?vpn5&asn3", ip);
    HTTP(playerid, HTTP_GET, string, "", "MyHttpResponse");
    return 1
}
stock bool:StrContains(const source[], const find[])
{
    new source_len = strlen(source);
    new find_len = strlen(find);
    for (new i = 0; i <= source_len - find_len; i++)
    {
        new match = true;
        for (new j = 0; j < find_len; j++)
        {
            if (source[i + j] != find[j])
            {
                match = false;
                break;
            }
        }
        if (match)
            return true;
    }
    return false;
}
forward MyHttpResponse(playerid, response_code, data[]);
public MyHttpResponse(playerid, response_code, data[])
{
    if(response_code == 200)
    {    
        if (StrContains(data, "\"proxy\": \"yes\"")) // Foi detectado
        {
            SendClientMessageToAll(0xFF0000FF, "[ANTI-VPN] %s foi kickado por suspeita de Vpn/Proxy.", GetPlayerName(playerid));
            Kick(playerid);
        }
        if (StrContains(data, "\"proxy\": \"no\"")) //  Nao foi detecado
        {
            SendClientMessageToAll(0x09F7DFC8, "[ANTI-VPN] %s(%d) nao foi detectado Proxy/Vpn. Jogador conectado!.", GetPlayerName(playerid), playerid);
        }
    }
    return 1;
}