Skip to content

Instantly share code, notes, and snippets.

@aveao
Last active September 3, 2016 08:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aveao/94acf6161a730102bacc3abeb975258c to your computer and use it in GitHub Desktop.
Save aveao/94acf6161a730102bacc3abeb975258c to your computer and use it in GitHub Desktop.
Simple VAC Ban checker. You can give custom url (ardaozkal) or steamid64 (76561198034299068) to it and it'll return true if the user is vac banned (or if the account is unable to be found).
static bool IsVacBanned(string steamID)
{
var wc = new WebClient();
string ProfileLink = "http://steamcommunity.com/";
ProfileLink += (steamID.StartsWith("765")) ? "profiles/" : "id/";
ProfileLink += steamID + "?xml=1";
var ProfileData = wc.DownloadString(ProfileLink);
return !ProfileData.Contains("<vacBanned>0</vacBanned>");
}
@aveao
Copy link
Author

aveao commented Sep 3, 2016

You can also do "using (var wc = new WebClient())".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment