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) (http://www.mediafire.com/file/3a1jh542rrphi51/IpToCountry.rar)
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 (http://vcmp.liberty-unleashed.co.uk/forum/index.php?topic=714.0)
Translated by me for Vice City Multiplayer 0.4 (Some things, almost nothing)
getting error here
db <- ConnectSQL( "IpToCountry.db" );
@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.
If you're actually getting an error then that probably means you haven't loaded the SQLite plugin.
The screenshot of the console error is needed to provide an proper solution Please Click Me Mr.Squirrel Master (http://forum.vc-mp.org/?topic=113.0)
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi60.tinypic.com%2F1havxg.png&hash=efa1e5b5a97792168bf19df3274c3fe364aed742)
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi61.tinypic.com%2Fvrzfon.png&hash=c378fcbacb009d394f2fe151aaf16975744ede05)
Now help
You're missing the SQLite database plugin (https://bitbucket.org/stormeus/0.4-sqlite/downloads).
Check have you loaded all plugins (execpt announce for localhost) in server.cfg
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.
i have add them but still error here
secondarydb <- ConnectSQL( "IpToCountry.db" );
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
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 (http://www.mediafire.com/download/3a1jh542rrphi51/IpToCountry.rar)
Virus Free : VirusTotal (https://www.virustotal.com/nl/file/a21cf590f089e514189a5d83dbcee079119f90afc2ca7e02064ab7f532e0e0cd/analysis/1441776721/)
Edit by Thijn: Replaced the VirusTotal link with an analysis of the actual file instead of mediafire. It's clean.
I get a txt msg in game "Playername Country: Unknown" while my country is in the db....
Quote from: Ron on Apr 14, 2016, 04:26 PMI get a txt msg in game "Playername Country: Unknown" while my country is in the db....
But your IP is not.
Yet, mate, you did a nice bump/
And also, leave this shits, there's a plugin for that, which works great!
http://forum.vc-mp.org/?topic=1478.0
Note: It doesn't support IPs like 127.0.0.1
Niice Work
@MatheuS,
I Have Created Command /country <Player> / ( Just For The Newbie Don't Know Scripting )
Here iTs Command:-else if ( cmd == "country" )
{
if ( !text ) MessagePlayer("[#ff0000][INFO][#ffffff] /country <Player>",player);
local plr = FindPlayer(text);
if(!plr) MessagePlayer("[#FF0000]Usage Error:[#FFFFFF] Unknown Player", player);
else
{
local country = IpToCountry( plr.IP );
MessagePlayer("[#00ffff][INFO][#ffffff] Country " + plr.Name + " is "+country+".",player );
}
return 0;
}
Hope iTs Help!
Nice Bro,Nice Work.
I M GETTING ERROR i can't fix it . ..
MAIN LINE 49 IPTOcountry/Iptocountry.nut line 7
Funcion:
function P_MSG( text, player ) MessagePlayer( "[#000000][[#9400D3]Pais[#000000]][#FFFFFF] " + text, player );
CMD:
else if ( cmd == "pais" )
{
if (status[ player.ID ].Registrado == false) MessagePlayer(RED+"**Usted no esta registrado!",player);
else if ( status[ player.ID ].Logado == false ) MessagePlayer(RED+"**Usted no ah iniciado sesion!",player);
else if ( !text ) MessagePlayer(ORANGE+"Usage: /" + cmd + " [Nick/ID]", player );
else {
local plr = GetPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) MessagePlayer(RED+" >> "+ORANGE+"Invalid Player.", player );
else {
local IP = plr.IP;
P_MSG( ""+plr.Name+" es de" + IpToCountry( plr.IP ) + ".", player );
}
}
return 0;
}
Quote from: =RK=MarineForce on May 08, 2018, 06:34 PMI M GETTING ERROR i can't fix it . ..
MAIN LINE 49 IPTOcountry/Iptocountry.nut line 7
post the error which is on console and what is written on the line 49. I think you use notepad. I recommend notepad++ as it makes easy to find the error on the specific line.
Fixed by ownself Thanks For Support
why showing unknow country? invalid ip? and need host it at vps
Quote from: =RK=MarineForce on May 13, 2018, 08:03 AMwhy showing unknow country? invalid ip? and need host it at vps
Since, it get ip 192.168......
This is localhost ip so thats why showing invalid. If any other player joins, he will see his country.
only for me showing ? unknow? and others tooo?
i hosted it at DMz Host At Router
Quote from: =RK=MarineForce on May 13, 2018, 04:33 PMonly for me showing ? unknow? and others tooo?
i hosted it at DMz Host At Router
Edit the ipcountry.nut and where it says unknow change it to your liking when you enter it will come out that.
@TakanaueWhy its showing Unkow bro can help me?
Quote from: =RK=MarineForce on Sep 08, 2018, 11:37 PM@Takanaue
Why its showing Unkow bro can help me?
Because you're starting the server from localhost I guess
Quote from: Takanaue on Sep 09, 2018, 12:15 AMBecause you're starting the server from localhost I guess
Sure thing.
There was a IPtocountry which Mohammed gave it to me it works in localhost too but i can't find bcz of i windows my pc. all old files removed.
I think Mohammed leaved VC-MP
Lmfao
i just added this
dofile( "IPtoCountry/IPtoCountry.nut" );
secondarydb <- ConnectSQL( "IPtoCountry/IpToCountry.db" );
it works Xddd
this changed by me .
Quote from: =RK=MarineForce on Sep 10, 2018, 11:05 AMLmfao
i just added this
dofile( "IPtoCountry/IPtoCountry.nut" );
secondarydb <- ConnectSQL( "IPtoCountry/IpToCountry.db" );
it works Xddd
this changed by me .
Quote from: Takanaue on Jan 11, 2015, 12:24 PMIP to Country (VCMP)
function onScriptLoad()
{
dofile( "IPtoCountry/IPtoCountry.nut" );
secondarydb <- ConnectSQL( "IpToCountry.db" );
}
Yes, it's really "Lmfao". >.<
mahmoud i already added this but its shows me unknow so i got help by other script hmhmm :P
you must be write: secondarydb <- ConnectSQL("IpToCountry.db");