[Include] IP Lookup Script
#16

Quote:
Originally Posted by vannesenn
Посмотреть сообщение
Give us code from ipl.inc from line 65
Код:
public HTTP_OnLookupResponse(index, response, data[])
{
	new pos = -1;

	if (!IsPlayerConnected(index)) return 0;
	else if (response == 200)
	{
	    if (strfind(data, "Reserved", true) != -1 || strlen(data) < 15)
		{
	        return 0;
		}
		else
		{
			new country[MAX_COUNTRY_NAME],region[MAX_COUNTRY_NAME],city[MAX_COUNTRY_NAME],isp[MAX_COUNTRY_NAME];

			if ((pos = strfind(data, "\"country\":")) != -1)
			{
			    pos = pos + 11;

				strmid(country, data, pos, strfind(data, "\"", true, pos), MAX_COUNTRY_NAME);
			}
			if ((pos = strfind(data, "\"regionName\":")) != -1)
			{
			    pos = pos + 14;

				strmid(region, data, pos, strfind(data, "\"", true, pos), MAX_COUNTRY_NAME);

			}
			if ((pos = strfind(data, "\"city\":")) != -1)
			{
			    pos = pos + 8;

				strmid(city, data, pos, strfind(data, "\"", true, pos), MAX_COUNTRY_NAME);
			}

			if ((pos = strfind(data, "\"isp\":")) != -1)
			{
			    pos = pos + 7;

				strmid(isp, data, pos, strfind(data, "\"", true, pos), MAX_COUNTRY_NAME);
			}

			if (pos != -1)
			{
			    strpack(g_asLookupData[index][e_LookupCountry], country, MAX_COUNTRY_NAME char);
			    strpack(g_asLookupData[index][e_LookupRegion], region, MAX_COUNTRY_NAME char);
			    strpack(g_asLookupData[index][e_LookupCity], city, MAX_COUNTRY_NAME char);
			    strpack(g_asLookupData[index][e_LookupISP], isp, MAX_COUNTRY_NAME char);
				CallLocalFunction("OnLookupComplete", "dssss", index, country, region, city, isp);
			}
		}
	}
	return 0;
}
line 65 = CallLocalFunction("OnLookupComplete", "dssss", index, country, region, city, isp);
Reply


Messages In This Thread
IP Lookup Script - by Banana_Ghost - 17.05.2016, 10:19
Re: IP Lookup Script - by JustMe.77 - 17.05.2016, 18:28
Re: IP Lookup Script - by Banana_Ghost - 18.05.2016, 08:50
Re: IP Lookup Script - by Miller007 - 18.05.2016, 08:55
Re: IP Lookup Script - by Zorono - 18.05.2016, 10:10
Re: IP Lookup Script - by justice96 - 18.05.2016, 10:15
Re: IP Lookup Script - by Banana_Ghost - 18.05.2016, 12:34
Respuesta: IP Lookup Script - by dannypanda05 - 18.05.2016, 13:09
Re: IP Lookup Script - by HydraHumza - 18.05.2016, 13:40
Re: IP Lookup Script - by Private200 - 18.05.2016, 16:00
Re: IP Lookup Script - by N0FeaR - 18.05.2016, 19:27
Re: IP Lookup Script - by muhsah007 - 02.06.2016, 20:49
Re: IP Lookup Script - by zSuYaNw - 02.06.2016, 21:04
Re: IP Lookup Script - by vannesenn - 02.06.2016, 22:19
Re: IP Lookup Script - by PT - 04.06.2016, 12:05
Re: IP Lookup Script - by muhsah007 - 04.06.2016, 18:13
Re: IP Lookup Script - by Banana_Ghost - 05.06.2016, 09:51
Re: IP Lookup Script - by Banana_Ghost - 05.06.2016, 09:55
Re: IP Lookup Script - by iLearner - 27.11.2016, 20:32
Re: IP Lookup Script - by GoldenMan - 29.08.2017, 13:25

Forum Jump:


Users browsing this thread: 2 Guest(s)