Error error CS0103

Hello guys i have problem :frowning: please help

Assets/Scripts/MultiplayerManager.cs(68,39): error CS0103: The name `View’ does not exist in the current context

using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class MultiplayerManager : MonoBehaviour 
{
	public static MultiplayerManager instance;
	
	public string PlayerName;
	
	private string MatchName = "";
	private string MatchPassword = "";
	private int MatchMaxUsers = 32;
	
	public List<MPPlayer> PlayerList = new List<MPPlayer>();
	
    void Start()
	{
		instance = this;
	}
	
	public void StartServer(string servername, string serverpassword, int maxusers)
	{
		MatchName = servername;
		MatchPassword = serverpassword;
		MatchMaxUsers = maxusers;
		Network.InitializeServer (MatchMaxUsers, 2550, false);
		Network.InitializeSecurity();
  	}
	
	void OnServerInitialized()
	{
		Server_PlayerJoinRequest("", Network.player);
	}
	
	void OnConncetedToServer()
	
	{
	    networkView.RPC("Server_PlayerJoinRequest", RPCMode.Server, "", Network.player);
	}
	
	void OnPlayerDisconnected(NetworkPlayer id)
	{
		networkView.RPC("Client_RemovePlayer", RPCMode.All, id);
	}
	
	[RPC]
	void Server_PlayerJoinRequest(string playername, NetworkPlayer View)
	{
		networkView.RPC("Client_AddPlayerToList", RPCMode.All, playername, View);
	}
	
	[RPC]
	void Client_AddPlayerToList(string playername, NetworkPlayer View)
	{
		MPPlayer tempplayer = new MPPlayer();
		tempplayer.Playername = playername;
		tempplayer.PlayerNetwork = View;
		PlayerList.Add (tempplayer);
	}
	
	[RPC]
	void Client_RemovePlayer()
	{
		MPPlayer temppl = null;
	foreach(MPPlayer pl in PlayerList)
	{
		if(pl.PlayerNetwork = View)
			{
				temppl = pl;
			}
		}
		if(temppl != null)
		{
			PlayerList.Remove(temppl);
	
		}
		}
}
	

public class MPPlayer
{
	public string Playername = "";
	public NetworkPlayer PlayerNetwork;
}

anyone ?

you realize the compiler is telling you whats wrong, right? What have you tried to fix your own problem?

i was wondering maybe is capital letter but isnt :frowning:

View has not been defined in this context means you have not told the computer actually what a View is for this local section of code. Look at your other functions where View was used. If you look up at the function defintion one of the peramaters was NetworkPlayer View now you look to the definition of the function that your code error is at and see void Client_RemovePlayer() does not actually define NetworkPlayer View nor do you define it anywhere in the function. Thus is does not exist in this context.

Also:
Comparisons for equality are double equals not a single equal.

What you’re attempting with
if(pl.PlayerNetwork = View)
“If I set pl.PlayerNetwork to View is the returned result true or false?”

which is not the same as
if(pl.PlayerNetwork == View)
“If I compare pl.PlayerNetwork to View are they equal?”.

Good luck on your project I have a feeling you’re going to need it.

Didnt fixed error :frowning: Thanks anyway

void Client_RemovePlayer()

That function declartion is missing it’s arguments. One of them should be ‘View’.