[Ajuda] Anti-Proxy/VPN nгo funciona
#1

Olб, eu estava a procura de um Anti-Proxy quando vi esse aqui, sу que ele nгo funciona, nгo manda debug dizendo se estб com Anit-Proxy, se nгo estб em fim... serб que й a include a_http? Se for e alguйm tiver ela atualizada e quiser mandar pra mim, agradeзo.

PHP код:
new ip[16], string[59];
GetPlayerIp(playeridipsizeof ip);
format(stringsizeof string"http://proxy.mind-media.com/block/proxycheck.php?ip=%s"ip);
HTTP(playeridHTTP_GETstring"""MyHttpResponse");
forward MyHttpResponse(playeridresponse_codedata[]);
public 
MyHttpResponse(playeridresponse_codedata[])
{
    new 
name[MAX_PLAYERS],string[256];
    new 
ip[16];
    
GetPlayerName(playeridnamesizeof(name));
    
GetPlayerIp(playeridipsizeof ip);
    if(
strcmp(ip"127.0.0.1"true) == 0)
    {
        
format(string256"[LOCALHOST] %s(%d) has joined the server."nameplayerid);
        
SendClientMessageToAll0x09F7DFC8string);
        return 
1;
    }
    if(
response_code == 200)
    {
        if(
data[0] == 'Y')
        {
            
SendClientMessage(playeridCOLOR_LIGHTRED"[ANTI-PROXY]: Proxy Detectado, desligue seu Proxy/VPN senao ira ser kickado !");
            
format(stringsizeof(string), "[ANTI-PROXY] Player %s foi kickado por suspeita de Proxy/VPN"pName[playerid]);
            
ABroadCast(COLOR_LIGHTREDstring1);
            
printf("Proxy Detectado !");
            
SetTimerEx("DelayedKick"100false"i"playerid);
        }
        if(
data[0] == 'N')
        {
            
printf("Proxy nao detectado !");
        }
        if(
data[0] == 'X')
        {
            
printf("WRONG IP FORMAT");
        }
        else
        {
            
printf("The request failed! The response code was: %d"response_code);
        }
    }
    return 
1;
}
forward DelayedKick(playerid);
DelayedKick(playerid)
{
    
Kick(playerid);
    return 
1;

Reply
#2

- Por ser string, vocк precisa usar strcmp.

PHP код:
if(strcmp(data"N"true) == 0) {
}
else if(
strcmp(data"Y"true) == 0) {
}
else if(
strcmp(data"X"true) == 0) {

Tente assim!

- PS: Nгo й necessбrio colocar http durante a solicitaзгo!
Reply
#3

Funcionou, mas nгo ta dando Spawn no player
PHP код:
public MyHttpResponse(playeridresponse_codedata[])
{
    new 
name[MAX_PLAYERS],string[256];
    new 
ip[16];
    
GetPlayerName(playeridnamesizeof(name));
    
GetPlayerIp(playeridipsizeof ip);
    if(
strcmp(ip"127.0.0.1"true) == 0)
    {
        if(
gPlayerLogged[playerid] == && NaoPodeLogar[playerid] == 0)
        {
            if(
isPlayerRegistered(pName[playerid]))
            {
                
showDialogLogin(playerid);
            }
            else
            {
                
showDialogRegister(playerid);
            }
            
printf("Nao contem proxy !");
        }
        return 
1;
    }
    if(
response_code == 200)
    {
        if(
strcmp(data"N"true) == 0)
        {
            if(
gPlayerLogged[playerid] == && NaoPodeLogar[playerid] == 0)
            {
                if(
isPlayerRegistered(pName[playerid]))
                {
                    
showDialogLogin(playerid);
                }
                else
                {
                    
showDialogRegister(playerid);
                }
                
SetSpawnInfo(playeridplayerid+1PlayerInfo[playerid][pSkin],1191.8226, -1744.047613.58020.0, -1, -1, -1, -1, -1, -1);
                
SetPlayerPos(playerid1243.2336, -1694.1256,16.1976);
                
printf("Nao contem proxy !");
            }
        }

        else if(
strcmp(data"Y"true) == 0)
        {
            
SendClientMessage(playeridCOLOR_LIGHTRED"[ANTI-PROXY]: Proxy Detectado, desligue seu Proxy/VPN senao ira ser kickado !");

            
format(stringsizeof(string), "[ANTI-PROXY] Player %s foi kickado por suspeita de Proxy/VPN"pName[playerid]);
            
ABroadCast(COLOR_LIGHTREDstring1);
            
printf("Proxy Detectado !");
            
SetTimerEx("DelayedKick"100false"i"playerid);
        }

        else if(
strcmp(data"X"true) == 0)
        {
            
printf("WRONG IP FORMAT");
        }
        else
        {
            
printf("The request failed! The response code was: %d"response_code);
        }
    }
    return 
1;

Reply
#4

Vocк jб estб chamando showDialogLogin/showDialogRegister, sendo assim, nгo й necessбrio colocar o spawn.
Vocк deve colocar o spawn na funзгo de logar o jogador.
Reply
#5

Consegui... sу que tipo, tlgd quando vocк usa a funзгo TogglePlayerSpectating ai o player fica com a cвmera lб no cйu com a vista da praia? Entгo, no meu ta assim e nem estou usando TogglePlayerSpectating
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)