[FilterScript] Country Detector

Started by MatheuS, Jan 11, 2015, 12:24 PM

Previous topic - Next topic

MatheuS

                                                          IP to Country (VCMP)

This can be useful for some people, things like countrybans(lol), language detectors, or just to admin purposes.

Download:
Click Here (MediaFire)

Installation:

Extract the files that are in the IPtoCountry folder in your server's root directory, add

function onScriptLoad()
{
   dofile( "IPtoCountry/IPtoCountry.nut" );
    secondarydb <- ConnectSQL( "IpToCountry.db" );
}

function onScriptUnload()
{
    DisconnectSQL( secondarydb );
}

function onPlayerJoin( player )
{
local country = IpToCountry( player.IP );
        Message( "[#F5FFFA]"+player.Name+" Country: [#06FA16]"+country+"[#F5FFFA]." );
}

Original scripts developed by Nexus
Link:Here

Translated by me for Vice City Multiplayer 0.4 (Some things, almost nothing)
if( !sucess ) tryAgain();
Thanks to the VCMP community. It was the happiest period of my life.

PsyChO_KiLLeR

getting error here
db <- ConnectSQL( "IpToCountry.db" );

jayant

@MatheuS
function onScriptLoad()
{
   dofile( "IPtoCountry/IPtoCountry.nut" );
   secondarydb <- ConnectSQL( "IpToCountry.db" );
   Load_ITC( "IPtoCountry/" ); // Loading the detector
}
From the original topic.. ^^ ;)

.

Quote from: Squirrel Master on Feb 27, 2015, 01:14 PMgetting error here
db <- ConnectSQL( "IpToCountry.db" );

Check that the database file "IpToCountry.db" exists and that it's accessible to the script or at least actually located where the script expects it to be.

Check the permissions on that database file if you're on a Unix system. Even if you're on windows you should still check them but Unix system are more sensitive bout that.

Finally if you still can't get it working then take a screenshot of the console output so that we can see what happens there.
.

Thijn

If you're actually getting an error then that probably means you haven't loaded the SQLite plugin.

MacTavish

#5
The screenshot of the console error is needed to provide an proper solution Please Click Me Mr.Squirrel Master

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

PsyChO_KiLLeR


.

.

MacTavish

Check have you loaded all plugins (execpt announce for localhost) in server.cfg

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

PsyChO_KiLLeR

what i have to add in server.cfg file?

.

Quote from: Squirrel Master on Feb 27, 2015, 07:03 PMwhat i have to add in server.cfg file?

plugins squirrel04rel32 sqlite04rel32
sqgamemode your_gamemode.nut

Please note that some of the plugin names might vary based on the platform you're on.
.

PsyChO_KiLLeR

i have add them but still error here
secondarydb <- ConnectSQL( "IpToCountry.db" );

PsyChO_KiLLeR

work fine now error was in some places there is db and in some places there is secondarydb i change all to db and then work fine
Thnx Slc and beztone

Drake

#13
BUMP

I saw that the IP to Country DB is really outdated so I just managed to update it with the latest IPs and thought of sharing it here.
Hope it helps. :)

Link : IpToCountry
Virus Free : VirusTotal

Edit by Thijn: Replaced the VirusTotal link with an analysis of the actual file instead of mediafire. It's clean.

Eva

I get a txt msg in game "Playername Country: Unknown" while my country is in the db....