Re: GeoLite -
Calisthenics - 05.02.2020
Databases were updated for
February 2020:
https://github.com/George480/geolite/releases/tag/v16.0
Re: GeoLite -
Calisthenics - 08.02.2020
For those of you (non-sampctl users) that use community compiler version 3.10.10 (released an hour ago), you will need to modify a_sampdb.inc and change lines 12 and 14:
pawn Code:
native DB:db_open(name[]);
native DBResult:db_query(DB:db, query[]);
to:
pawn Code:
native DB:db_open(const name[]);
native DBResult:db_query(DB:db, const query[]);
in order to fix warning 239: literal array/string passed to a non-const parameter.
Re: GeoLite -
Whitetiger - 19.02.2020
Great job, glad you could improve upon what I made some years back!
Re: GeoLite -
Calisthenics - 19.02.2020
Quote:
Originally Posted by Whitetiger
Great job, glad you could improve upon what I made some years back!
|
Thank you, I appreciate it.
Re: GeoLite -
Calisthenics - 04.03.2020
Databases were updated for
March 2020:
https://github.com/George480/geolite/releases/tag/v17.0
Re: GeoLite -
PurmeX - 07.04.2020
Hi, is it possible to add an IP address to exceptions? I have a lot of regular players and can't play, thanks in advance for your help
I want to unlock ip players not locations
Code:
if(!IsAdminPlayer(playerid))
{
{
if(strcmp(player_country, "Egypt", true))
{
BoxInfo(playerid, ""RED""GOLD"Entries from foreign IPs have been blocked");
KickPlayer(playerid, -1, "Foreign IP");
}
}
}
Re: GeoLite -
Calisthenics - 07.04.2020
Quote:
Originally Posted by PurmeX
Hi, is it possible to add an IP address to exceptions? I have a lot of regular players and can't play, thanks in advance for your help
I want to unlock ip players not locations
Code:
if(!IsAdminPlayer(playerid))
{
{
if(strcmp(player_country, "Egypt", true))
{
BoxInfo(playerid, ""RED""GOLD"Entries from foreign IPs have been blocked");
KickPlayer(playerid, -1, "Foreign IP");
}
}
}
|
Hello, adding an exception to current tables cannot be done because it saves them as IP ranges. However you can create your own whitelist for IPs or names to allow them join in case they are outside of Egypt.
Re: GeoLite -
PurmeX - 07.04.2020
Thank you
Re: GeoLite -
Calisthenics - 08.04.2020
Databases were updated for
April 2020:
https://github.com/George480/geolite/releases/tag/v18.0
Re: GeoLite -
Symon - 08.04.2020
Thank you, may come in handy for sure.
Is it possible to categorize countries in order to make a top 10?
Re: GeoLite -
Calisthenics - 09.04.2020
City in Veracruz, Mexico is 108 characters long. Updated `MAX_CITY_LENGTH` constant, please re-download the include file:
https://raw.githubusercontent.com/Ge...er/geolite.inc
or change it manually to 109.
Quote:
Originally Posted by Symon
Is it possible to categorize countries in order to make a top 10?
|
What do you mean? From which country most players were connected?
Re: GeoLite -
Calisthenics - 06.05.2020
Databases were updated for
May 2020:
https://github.com/George480/geolite/releases/tag/v19.0
Re: GeoLite -
Feanor - 19.05.2020
Calisthenics, I wrote you PM regarding your include.
Could you please check it out?
Re: GeoLite -
JR_Junior - 25.05.2020
Is not working for me:
new string[50];
GetPlayerCountry(playerid, string, sizeof(string));
strmid(PlayerInfo[playerid][GeoCountry], string, 0, sizeof(string), 255);
GetPlayerCity(playerid, string, sizeof(string));
strmid(PlayerInfo[playerid][GeoCity], string, 0, sizeof(string), 255);
No data in the string!
Re: GeoLite -
Calisthenics - 25.05.2020
`maxmind_country.db` and `maxmind_city.db` must be located in scriptfiles folder otherwise the functions will return 0.
pawn Code:
GetPlayerCountry(playerid, PlayerInfo[playerid][GeoCountry], MAX_COUNTRY_LENGTH);
GetPlayerCity(playerid, PlayerInfo[playerid][GeoCity], MAX_CITY_LENGTH);
Re: GeoLite -
JR_Junior - 25.05.2020
Quote:
Originally Posted by Calisthenics
`maxmind_country.db` and `maxmind_city.db` must be located in scriptfiles folder otherwise the functions will return 0.
pawn Code:
GetPlayerCountry(playerid, PlayerInfo[playerid][GeoCountry], MAX_COUNTRY_LENGTH); GetPlayerCity(playerid, PlayerInfo[playerid][GeoCity], MAX_CITY_LENGTH);
|
All files is on the correct place and I've tried getting info like this way too... but nothing, no errors, but no data too.
Re: GeoLite -
Calisthenics - 25.05.2020
Quote:
Originally Posted by JR_Junior
All files is on the correct place and I've tried getting info like this way too... but nothing, no errors, but no data too.
|
Database files in correct place, correct permissions to read from scriptfiles and connected (in case you use it on another player). Here is a sample with correct output:
pawn Code:
#include <a_samp>
#include <sscanf2>
#include <geolite>
#include <zcmd>
enum e_PlayerInfo
{
GeoCountry[MAX_COUNTRY_LENGTH],
GeoCity[MAX_CITY_LENGTH]
};
new PlayerInfo[MAX_PLAYERS][e_PlayerInfo];
CMD:mycountry(playerid, params[])
{
if (isnull(PlayerInfo[playerid][GeoCountry]) && isnull(PlayerInfo[playerid][GeoCity]))
{
GetPlayerCountry(playerid, PlayerInfo[playerid][GeoCountry], MAX_COUNTRY_LENGTH);
GetPlayerCity(playerid, PlayerInfo[playerid][GeoCity], MAX_CITY_LENGTH);
}
printf("Country: %s, City: %s", PlayerInfo[playerid][GeoCountry], PlayerInfo[playerid][GeoCity]);
return 1;
}
Re: GeoLite -
JR_Junior - 25.05.2020
Quote:
Originally Posted by Calisthenics
Database files in correct place, correct permissions to read from scriptfiles and connected (in case you use it on another player). Here is a sample with correct output:
pawn Code:
#include <a_samp> #include <sscanf2> #include <geolite> #include <zcmd>
enum e_PlayerInfo { GeoCountry[MAX_COUNTRY_LENGTH], GeoCity[MAX_CITY_LENGTH] };
new PlayerInfo[MAX_PLAYERS][e_PlayerInfo];
CMD:mycountry(playerid, params[]) { if (isnull(PlayerInfo[playerid][GeoCountry]) && isnull(PlayerInfo[playerid][GeoCity])) { GetPlayerCountry(playerid, PlayerInfo[playerid][GeoCountry], MAX_COUNTRY_LENGTH); GetPlayerCity(playerid, PlayerInfo[playerid][GeoCity], MAX_CITY_LENGTH); } printf("Country: %s, City: %s", PlayerInfo[playerid][GeoCountry], PlayerInfo[playerid][GeoCity]); return 1; }
|
My VPS was blocked the db files to be readed... now is working! Thank You!
Re: GeoLite -
Calisthenics - 03.06.2020
Databases were updated for
June 2020:
https://github.com/George480/geolite/releases/tag/v20.0
Update
geolite.inc:
https://raw.githubusercontent.com/Ge...er/geolite.inc
- Added new database maxmind_province.db requested by Walter-Correa
- Added two new functions:
pawn Code:
native GetIpProvince(const geolite_ip[], geolite_dest[], geolite_len = sizeof (geolite_dest));
native GetPlayerProvince(playerid, geolite_dest[], geolite_len = sizeof (geolite_dest));
NOTE: This version includes many duplicated province names because it was slow to re-arrange geoname_id with a unique id for 2.5 millions rows. If I manage to find a way to do it, the size of maxmind_province.db will be reduced drastically.
Re: GeoLite -
Calisthenics - 08.07.2020
Databases were updated for
July 2020:
https://github.com/George480/geolite/releases/tag/v21.0
Province database will be uploaded tomorrow because it takes too long.
EDIT: I was unable to get the province database, timed out twice for taking too long.