No overload for method `OnPlayerDisconnected' takes `0' arguments

//My Menu Script

        if(GUI.Button(new Rect(530,480,300,100),Back))

//my Network Manager Script

public void OnPlayerDisconnected(NetworkPlayer id)
	Debug.Log("A Player is Leaving");
	networkView.RPC("RemovePlayer", RPCMode.All, id);
	Debug.Log("A Player is Left");

simple getting the void function but i dont know what is this error thank you … for helping me in advance…



You need to pass a “NetworkPlayer” here.

OnPlayerDisconnected is a callback, you never call it manually. It is called by unity when a player disconnects.

To disconnect a player from the server you should simply call Network.Disconnect. Note: when called on the server it would close the server.

To “forcefully” disconnect a player on the server (kick the player) you should use Network.CloseConnection and pass the player you want to disconnect.

When you do this OnPlayerDisconnected will be called by unity.