Post: [Release]Get Server Details C#
02-25-2014, 06:04 PM #1
Mango_Knife
In my man cave
(adsbygoogle = window.adsbygoogle || []).push({}); Hey guys

Welcome and today im release a function that originaly made by Seb5594, but i just converted it to mw2 Awesome face
So if you are using this dont forget to give credits to Seb5594

Alright so this is how you are using that:

1) Add this code somewhere on your project:
    
//Please Credit Seb5594, Shark And Mango_Knife
#region Boolean's
public static Boolean InGame()
{
return Lib.ReadBool(0x01D17A8C);
}
private static String ReturnInfos(Int32 Index)
{
return Encoding.ASCII.GetString(Lib.GetBytes(0x17A54E0, 0x234)).Replace(@"\", "|").Split('|'Winky Winky[Index];
}
private static String OnlineInfos(Int32 Index)
{
return Encoding.ASCII.GetString(Lib.GetBytes(0x009aa2d9, 0x234)).Replace(@"\", "|").Split('|'Winky Winky[Index];
}
private static Boolean Online()
{
if (ReturnInfos(1) == "cg_predictItems")
{
return true;
}
else
{
return false;
}
}
#endregion
#region Host Name?
public static String getHostName()
{
if (InGame())
{
if (Online())
{
return ReturnInfos(Cool Man (aka Tustin);
}
else
{
return ReturnInfos(16);
}
}
else { return "Not in game"; }
}
#endregion
#region Max Players?
public static String getMaxPlayers()
{
if (InGame())
{
if (Online())
{
return OnlineInfos(1Cool Man (aka Tustin);
}
else
{
return ReturnInfos(1Cool Man (aka Tustin);
}
}
else { return "Not in game"; }
}
#endregion
#region Gamemode
public static String getGameMode()
{
if (InGame())
{
if (Online())
{
//Online
switch (OnlineInfos(2))
{
default: return "Unknown Gametype";
case "1": return "Loading Game";
case "war": return "Team Deathmatch";
case "dm": return "Free for All";
case "sd": return "Search and Destroy";
case "dom": return "Domination";
case "dem": return "Demolition";
case "gtnw": return "Global Thermonuclear War";
case "ctf": return "Capture The Flag";
case "arena": return "Arena";
}
}
else
{
//Private Match
switch (ReturnInfos(2))
{
default: return "Unknown Gametype";
case "1": return "Loading Game";
case "war": return "Team Deathmatch";
case "dm": return "Free for All";
case "sd": return "Search and Destroy";
case "dom": return "Domination";
case "dem": return "Demolition";
case "gtnw": return "Global Thermonuclear War";
case "ctf": return "Capture The Flag";
case "arena": return "Arena";
}
}
}
else { return "Not in game"; }
}
#endregion
#region Hardcore?
public static String getHardcore()
{
if (InGame())
{
if (Online())
{
switch (OnlineInfos(4))
{
default: return "Unknown Gametype";
case "20000": return "Loading Game";
case "0": return "Off";
case "1": return "On";
}
}
else
{
switch (ReturnInfos(4))
{
default: return "Unknown Gametype";
case "20000": return "Loading Game";
case "0": return "Off";
case "1": return "On";
}
}
}
else { return "Not in game"; }
}
#endregion
#region Map
public static String get_MapName()
{
String str = Lib.ReadString(0xD495F4), MapStr = "Not in game";
if (InGame())
{
if (str.Contains("afghan"))
MapStr = "Afghan";
if (str.Contains("highrise"))
MapStr = "Highrise";
if (str.Contains("rundown"))
MapStr = "Rundown";
if (str.Contains("quarry"))
MapStr = "Quarry";
if (str.Contains("nightshift"))
MapStr = "Skidrow";
if (str.Contains("terminal"))
MapStr = "Terminal";
if (str.Contains("brecourt"))
MapStr = "Wasteland";
if (str.Contains("derail"))
MapStr = "Derail";
if (str.Contains("estate"))
MapStr = "Estate";
if (str.Contains("favela"))
MapStr = "Favela";
if (str.Contains("invasion"))
MapStr = "Invasion";
if (str.Contains("rust"))
MapStr = "Rust";
if (str.Contains("scrapyard") || str.Contains(("boneyard")))
MapStr = "Scrapyard";
if (str.Contains("sub"))
MapStr = "Subbase";
if (str.Contains("underpass"))
MapStr = "Underpass";
if (str.Contains("checkpoint"))
MapStr = "Karachi";
if (str.Contains("bailout"))
MapStr = "Bailout";
if (str.Contains("compact"))
MapStr = "Salvage";
if (str.Contains("storm") || str.Contains(("storm2")))
MapStr = "Storm";
if (str.Contains("crash"))
MapStr = "Crash";
if (str.Contains("overgrown"))
MapStr = "Overgrown";
if (str.Contains("strike"))
MapStr = "Strike";
if (str.Contains("vacant"))
MapStr = "Vacant";
if (str.Contains("trailerpark"))
MapStr = "Trailer Park";
if (str.Contains("fuel"))
MapStr = "Fuel";
if (str.Contains("abandon"))
MapStr = "Carnival";
if (str.Contains("dlc2_ui_mp"))
MapStr = "Not in game";
}
return MapStr;
}
#endregion


2) Put 10 labels somewhere you want the Server Details Function, it will be like that:
You must login or register to view this content.

3) Now insert this function on your Button:
label1.Text = getHostName();
label2.Text = getMapName();
label3.Text = getGameMode();
label4.Text = getHardcore();
label5.Text = getMaxPlayers();
It need to be match to those labels: You must login or register to view this content.

And thats all your done Smile
In the end you will get something like that:
You must login or register to view this content.
If you want to make this auto refresh just use timer:


Credits:
Mango_Knife - Updated this to Mw2.
Seb5594 - Original Function.
    
private void timer1_Tick(object sender, EventArgs e)
{
label1.Text = getHostName();
label2.Text = getMapName();
label3.Text = getGameMode();
label4.Text = getHardcore();
label5.Text = getMaxPlayers();
}
(adsbygoogle = window.adsbygoogle || []).push({});

The following 6 users say thank you to Mango_Knife for this useful post:

.MrRedDoT, FusionIsDaName, Hori_By_Nature, MoTmrD-, MrRambo, SnaY
08-24-2014, 10:51 PM #20
vezzdu11
Save Point
not work for me please help me !!! :(
You must login or register to view this content.
for use like this
You must login or register to view this content.
for "space map" on MW2 for AC 130 custom bullet etc

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo