I cannot figure out what my error is...

Hi, I am a beginner at programming in C#, and I need help with finding the issue that I am having right now. Here is the code below:

using UnityEngine;
using System.Collections;

public class NetworkManager : MonoBehaviour {

	private const string typeName = "UniqueGameName";
	private const string gameName = "RoomName";
	
	private void StartServer()
	{
		Network.InitializeServer(4, 25000, !Network.HavePublicAddress());
		MasterServer.RegisterHost(typeName, gameName);
	}
	
	void OnServerInitialized()
	{
		Debug.Log("Server Initializied");
	}
	
	void OnGUI()
	{
		if (!Network.isClient && !Network.isServer)
		{
			if (GUI.Button(new Rect(100, 100, 250, 100), "Start Server"))
				StartServer();
		}
	}

	private HostData[] hostList;
	
	private void RefreshHostList()
	{
		MasterServer.RequestHostList(typeName);
	}
	
	void OnMasterServerEvent(MasterServerEvent msEvent)
	{
		if (msEvent == MasterServerEvent.HostListReceived)
			hostList = MasterServer.PollHostList();
	}

	private void JoinServer(HostData hostData)
	{
		Network.Connect(hostData);
	}
	
	void OnConnectedToServer()
	{
		Debug.Log("Server Joined");
	}

	void OnGUI()
	{
		if (!Network.isClient && !Network.isServer)
		{
			if (GUI.Button(new Rect(100, 100, 250, 100), "Start Server"))
				StartServer();
			
			if (GUI.Button(new Rect(100, 250, 250, 100), "Refresh Hosts"))
				RefreshHostList();
			
			if (hostList != null)
			{
				for (int i = 0; i < hostList.Length; i++)
				{
					if (GUI.Button(new Rect(400, 100 + (110 * i), 300, 100), hostList*.gameName))*

_ JoinServer(hostList*);_
_
}_
_
}_
_
}_
_
}*_

* // Use this for initialization*
* void Start () {*

* }*

* // Update is called once per frame*
* void Update () {*

* }*
}

And my error says:
Assets/NetworkManager.cs(52,14): error CS0111: A member ‘NetworkManager.OnGUI()’ is already defined. Rename this member or use different parameter types
PLEASE HELP!
Thanks!
-Eric N.

You need to remove this code:

 void OnGUI()
 {
     if (!Network.isClient && !Network.isServer)
     {
         if (GUI.Button(new Rect(100, 100, 250, 100), "Start Server"))
             StartServer();
     }
 }

It is a subsection of the other function by the same name.

The error message is telling you that you cannot have two methods by the same name

In your script you have this code:

 void OnGUI()
 {
     if (!Network.isClient && !Network.isServer)
     {
         if (GUI.Button(new Rect(100, 100, 250, 100), "Start Server"))
             StartServer();
     }
 }

Further down you have this code:

 void OnGUI()
 {
     if (!Network.isClient && !Network.isServer)
     {
         if (GUI.Button(new Rect(100, 100, 250, 100), "Start Server"))
             StartServer();
         
         if (GUI.Button(new Rect(100, 250, 250, 100), "Refresh Hosts"))
             RefreshHostList();
         
         if (hostList != null)
         {
             for (int i = 0; i < hostList.Length; i++)
             {
                 if (GUI.Button(new Rect(400, 100 + (110 * i), 300, 100), hostList*.gameName))*

JoinServer(hostList*);*
}
}
}
}
You are not allowed to have two methods with the same name with the same number of parameters/type
If you delete the first version (which seems to be a subset of the second) the error will go away.