public static Dictionary<String, bool> HackStates = new Dictionary<String, bool>()
{
{"Godmode", false},
{"InfiniteMana", false }
};
public static void Toggle(String hack)
{
//Toggles the hack
HackStates[hack] = !HackStates[hack];
//Writes a new message to the text box of our client, string represents the message, and the number represents the RGB value of the color. Only you can see this message.
Main.NewText("[MPGH Tutorial Client] Set the hack state of " + hack + " to "HackStates[hack], 255, 0, 0);
}
if (message.StartsWith("~"))
{
if (message.StartsWith("~god"))
{
Toggle("Godmode");
}
else if (message.StartsWith("~infmana"))
{
Toggle("InfiniteMana");
}
...
}
public void Update(int i)
{
if (this.launcherWait > 0)
{
this.launcherWait--;
}
...
//In player.cs
public void Update(int i)
{
Hacks.onUpdate()
if (this.launcherWait > 0)
{
this.launcherWait--;
}
...
}
//In Hacks.cs
public static void onUpdate()
{
if (HackStates["InfiniteMana"])
{
Main.player[Main.myPlayer].statMana = Main.player[Main.myPlayer].statManaMax; //Set our current mana to our max mana
}
}