Help with COuntry Checker (rep +)
#1

I got this Filterscript and This what i get when i connect:
'
Reply
#2

show the code.
Reply
#3

pawn Код:
#define FILTERSCRIPT

#include <a_samp>
#include <iploc>

public OnFilterScriptInit()
{
    return 1;
}

public OnRetrieveIpLocation(playerid, country[])
{

    new
        szStr[ 145 ];

    GetPlayerName( playerid, szStr, MAX_PLAYER_NAME );

    format( szStr, sizeof( szStr ), "<SERVER> Welcome %s to the server. From %s", szStr, country );

    SendClientMessageToAll( -1, szStr );

}

public OnPlayerConnect( playerid )
{
    return 1;
}
Reply
#4

Not this...
search your code for Private Address and post the code around it.
If it isn't there post the include's code
Reply
#5

Ok here is the Hole Include Notepad
pawn Код:
#if !defined _samp_included
    #tryinclude <a_samp>

    #if !defined _samp_included
        #error "Can't find file "a_samp". Are your includes in the correct directory?"
    #endif
#endif


#if !defined HTTP
    #tryinclude <a_http>

    #if !defined HTTP
        #error "Can't find file "a_http". Are your includes in the correct directory?"
    #endif
#endif

#define MAX_COUNTRY_NAME                    (64)
#define MAX_CITY_NAME                       (64)

#define HTTP_REQUEST_IP                     ("api.hostip.info/get_html.php?ip=")

new g_HasORIL;

forward hostip_Response(playerid, response_code, data[]);
forward OnRetrieveIpLocation(playerid, country[]);

public hostip_Response(playerid, response_code, data[])
{

    if( g_HasORIL != -1 )
    {
        if( response_code == 200 )
        {
            new szCountryBuff[ MAX_COUNTRY_NAME ];
           
            if( data[0] != '(' )
            {
                new
                    _itr=9,
                    _citr
                ;

                while( data[ _itr ] != EOS )
                {
                    if( _itr == MAX_COUNTRY_NAME -1)
                    {

                        szCountryBuff[ _itr ] = EOS;
                        break;

                    }

                    if( data[ _itr ] == '\n')
                    {
                        szCountryBuff[ _itr ] = EOS;
                        break;
                    }

                    szCountryBuff[ _citr++ ] = data[ _itr++ ];

                }
            }
            else
            {

                strcat( szCountryBuff, "private country" );

            }

            CallLocalFunction( "OnRetrieveIpLocation", "ds", playerid, szCountryBuff );

        }
        else printf("<IPLocator Error> HTTP response code: %d", response_code );

    }
    else printf("<IPLocator Error> iploc included but the function OnRetrieveIpLocation was not found.");
}




////////////////////////////////////////////////////////////////////////////////
// CALLBACK HOOKS //////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
#if defined FILTERSCRIPT

    public OnFilterScriptInit()
    {
        print("\n--------------------------------------");
        print(" Iggys Ip Locator Loaded.");
        print("--------------------------------------\n");

        g_HasORIL = funcidx("OnRetrieveIpLocation");

        if(funcidx("iploc_OnFilterScriptInit") != -1)
        {
            return CallLocalFunction("iploc_OnFilterScriptInit", "");
        }

        return 1;
    }

    #if defined _ALS_OnFilterScriptInit
        #undef OnFilterScriptInit
    #else
        #define _ALS_OnFilterScriptInit
    #endif
    #define OnFilterScriptInit iploc_OnFilterScriptInit

    forward iploc_OnFilterScriptInit();

#else

    public OnGameModeInit()
    {
        print("\n--------------------------------------");
        print(" Iggys Ip Locator Loaded.");
        print("--------------------------------------\n");

        g_HasORIL = funcidx("OnRetrieveIpLocation");

        if (funcidx("iploc_OnGameModeInit") != -1)
        {
            return CallLocalFunction("iploc_OnGameModeInit", "");
        }
        return 1;
    }

    #if defined _ALS_OnGameModeInit
        #undef OnGameModeInit
    #else
        #define _ALS_OnGameModeInit
    #endif
    #define OnGameModeInit iploc_OnGameModeInit
    forward iploc_OnGameModeInit();

#endif

public OnPlayerConnect(playerid)
{
    if( g_HasORIL != -1 )
    {

        new
            _szIP[ 16 ],
            _szTmpStr[ 128 ];

        GetPlayerIp( playerid, _szIP, 16 );

        strcat( _szTmpStr, HTTP_REQUEST_IP );
        strcat( _szTmpStr, _szIP );

        HTTP( playerid, HTTP_GET, _szTmpStr, "", "hostip_Response");//request location of ip and send it to hostip_Response
    }

    if(funcidx("iploc_OnPlayerConnect") != -1)
    {
        return CallLocalFunction("iploc_OnPlayerConnect", "i", playerid) != -1;
    }
    return 1;

}

#if defined _ALS_OnPlayerConnect
    #undef OnPlayerConnect
#else
    #define _ALS_OnPlayerConnect
#endif
#define OnPlayerConnect iploc_OnPlayerConnect

forward iploc_OnPlayerConnect(playerid);

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
Reply
#6

search ur gamemode for Private Address
Reply
#7

Hey Look At the Post weer i got it from maybe that could help
https://sampforum.blast.hk/showthread.php?tid=337304
Reply
#8

it show private adreess because you are on a local ip i.e. if you upload this to some host then connect it will definitly show your country ,

since the ip of server is 192.168.1.... shows you connecting on your local host thats why it show private address
Reply
#9

Seriously didn't anybody notice this i mean most of you AS scripters should of noticed it but only Niko_boy did.

Here eat a cookie Niko :P
Reply
#10

Quote:
Originally Posted by [Lexi]
Посмотреть сообщение
Seriously didn't anybody notice this i mean most of you AS scripters should of noticed it but only Niko_boy did.

Here eat a cookie Niko :P
Yea nice niko and of course with your local ip addres it will show as " Private "
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)