Dio skripte: [ pawn ]vaš odgovor[ /pawn ]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): [ code ]vaš odgovor[ /code ]
Slika/video ingame problema(obavezno ako je ingame problem): link slike
forward GetPlayerCountry(index, response_code, data[]);
public GetPlayerCountry(index, response_code, data[])
{
new buffer;
if(response_code == 200)
{
new str, city, country, ippp, pName;
GetPlayerName(index, pName, sizeof(pName));
GetPlayerIp(index, ippp, 24);
format(buffer, sizeof(buffer), "%s", data);
strmid(str, buffer, 4, strlen(buffer)); // Cutting the 'OK' response...
strmid(city, str, strfind(str, ";", true) + 1, strfind(str, ";", true) + 3); // Getting City
strmid(country, str, strfind(str, ";", true) + 4, strlen(buffer)); // Getting Country
format(str, 256, "Ime igraca %s: Zemlja - "CRVENA"%s", pName, country);
SendAdminMessage(0xFFFF80C8, str);
}
else
{
new pName;
GetPlayerName(index, pName, sizeof(pName));
#if defined ALWAYS_RESPONSE
new IP;
GetPlayerIp(index, IP, sizeof(IP));
format(str, sizeof(str),"api.ipinfodb.com/v3/ip-country/?key="APIKEY"&ip=%s", IP);
HTTP(index, HTTP_GET, str, "", "GetPlayerCountry");
#else // Normal message, without country
//format(str, 120, "%s {FAFAFA}je usao na server.", pName);
//AdminGameMaster(GetPlayerColor(index), str);
#endif
}
}