20.02.2019, 14:48
Hey there I need help fast, so I was making a code like if players is from specific country he will not be able to join server (kicked). That countries are added with in-game cmd and saved in file, and loaded when server is started again. But my problem is this: I haven`t added any countries yet but no matter what country player is from he will be kicked, this is my code (I checked getting player`s country few times and its working perfectly (geolocation.inc))
This code in under OnPlayerConnect. I could show loading and saving that countries list but and I haven`t added any of them but Iam still getting kicked.
Code:
static country[50]; GetPlayerCountry(playerid, country, sizeof(country)); for(new i = 0; i < 200; i++) { if(!strcmp(country, vpncountry[i])) { hasvpn[playerid] = 1; } } if(hasvpn[playerid] == 1) { new stringaa[100]; format(stringaa, sizeof(stringaa), "--- Anti VPN --- %s is kicked because of VPN", GetName(playerid)); printf(stringaa); kick[playerid] = SetTimerEx("Kick", 1000, 0, "d", playerid); }