05.02.2020, 10:22
Databases were updated for February 2020: https://github.com/George480/geolite/releases/tag/v16.0
native DB:db_open(name[]);
native DBResult:db_query(DB:db, query[]);
native DB:db_open(const name[]);
native DBResult:db_query(DB:db, const query[]);
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"); } } }
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"); } } } |
GetPlayerCountry(playerid, PlayerInfo[playerid][GeoCountry], MAX_COUNTRY_LENGTH);
GetPlayerCity(playerid, PlayerInfo[playerid][GeoCity], MAX_CITY_LENGTH);
`maxmind_country.db` and `maxmind_city.db` must be located in scriptfiles folder otherwise the functions will return 0.
pawn Code:
|
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.
|
#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;
}
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:
|
native GetIpProvince(const geolite_ip[], geolite_dest[], geolite_len = sizeof (geolite_dest));
native GetPlayerProvince(playerid, geolite_dest[], geolite_len = sizeof (geolite_dest));