View Single Post
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 10-22-2016 , 20:06   Re: [CS:GO] PTaH - V1.0
Reply With Quote #5

Quote:
Originally Posted by komashchenko View Post
can you give an example of what you would like to see?
something like this i guess:
Code:
public void OnPluginStart()
{
	// uses the system's dns resolver
	PTaH_GetHostByName("google.com", OnDNSLookup_Success, OnDNSLookup_Failure);
	
	// custom dns resolver
	PTaH_GetHostByName_Custom("google.com", OnDNSLookup_Success, OnDNSLookup_Failure, "8.8.4.4");
}

public void OnDNSLookup_Success(int ipaddress[4])
{
	PrintToServer("IP: %d.%d.%d.%d", ipaddress >>> 24 & 255, ipaddress >>> 16 & 255, ipaddress >>> 8 & 255, ipaddress & 255);
}

public void OnDNSLookup_Failure(const char[] reason)
{
	PrintToServer("Lookup failed! Reason: %s", reason);
}
__________________
retired

Last edited by shavit; 10-22-2016 at 20:07.
shavit is offline