ChoppySloppy542
ChoppySloppy542
CC#
Created by ChoppySloppy542 on 10/18/2024 in #help
The Given key was not present in the dictionary
KeyNotFoundException: The given key was not present in the dictionary. System.Collections.Generic.Dictionary`2[PhotonPlayer,Zombie3D.Player].get_Item (.PhotonPlayer key) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:150) Zombie3D.GameMultiplayerScene.HandleEvent (.ServerEventData data) (at Assets/Scripts/Assembly-CSharp/Zombie3D/GameMultiplayerScene.cs:222) PunCallback.OnServerEvent (.ServerEventData data) (at Assets/Scripts/Assembly-CSharp/PunCallback.cs:85) PunCallback.OnEvent (Byte eventCode, System.Object content, Int32 senderId) (at Assets/Scripts/Assembly-CSharp/PunCallback.cs:66) NetworkingPeer
9 replies
CC#
Created by ChoppySloppy542 on 10/18/2024 in #help
The Given key was not present in the dictionary
bascially the key or photon player is not in the SFS_Player_Arr dictionary. this happens when 1 player tries to revive the other but it cant because it cant find the photon player or key in the dictionary causing this error for refrence here is the unity console
9 replies
CC#
Created by ChoppySloppy542 on 10/18/2024 in #help
The Given key was not present in the dictionary
public void BirthPlayer(PhotonPlayer player)
{
if (!SFS_Player_Arr.ContainsKey(player))
{
Multiplayer multiplayer = new Multiplayer(player.ID);
multiplayer.InitAvatar((AvatarType)player.customProperties["avatarType"], (uint)(int)player.customProperties["birthPoint"]);
multiplayer.InitWeaponList((int)player.customProperties["weapon1"], (int)player.customProperties["weapon2"], (int)player.customProperties["weapon3"]);
SFS_Player_Arr.Add(player, multiplayer);
multiplayer.nick_name = (string)player.customProperties["nickname"];
multiplayer.Init();
multiplayer.ChangeWeaponWithindex((int)player.customProperties["weaponNum"]);
}
}
public void InitializePlayer(PhotonPlayer player)
{
// Check if the player is already added, if not, add them
BirthPlayer(player);
}

public void OnPlayerJoin(PhotonPlayer newPlayer)
{
InitializePlayer(newPlayer);
}

public override void DoLogic(float deltaTime)
{
if (!is_game_excute)
{
return;
}
player.DoLogic(deltaTime);
if (!is_game_over && PhotonNetwork.isMasterClient)
{
object[] array = new object[enemyList.Count];
enemyList.Keys.CopyTo(array, 0);
for (int i = 0; i < array.Length; i++)
{
Enemy enemy = enemyList[array[i]] as Enemy;
enemy.DoLogic(deltaTime);
public void BirthPlayer(PhotonPlayer player)
{
if (!SFS_Player_Arr.ContainsKey(player))
{
Multiplayer multiplayer = new Multiplayer(player.ID);
multiplayer.InitAvatar((AvatarType)player.customProperties["avatarType"], (uint)(int)player.customProperties["birthPoint"]);
multiplayer.InitWeaponList((int)player.customProperties["weapon1"], (int)player.customProperties["weapon2"], (int)player.customProperties["weapon3"]);
SFS_Player_Arr.Add(player, multiplayer);
multiplayer.nick_name = (string)player.customProperties["nickname"];
multiplayer.Init();
multiplayer.ChangeWeaponWithindex((int)player.customProperties["weaponNum"]);
}
}
public void InitializePlayer(PhotonPlayer player)
{
// Check if the player is already added, if not, add them
BirthPlayer(player);
}

public void OnPlayerJoin(PhotonPlayer newPlayer)
{
InitializePlayer(newPlayer);
}

public override void DoLogic(float deltaTime)
{
if (!is_game_excute)
{
return;
}
player.DoLogic(deltaTime);
if (!is_game_over && PhotonNetwork.isMasterClient)
{
object[] array = new object[enemyList.Count];
enemyList.Keys.CopyTo(array, 0);
for (int i = 0; i < array.Length; i++)
{
Enemy enemy = enemyList[array[i]] as Enemy;
enemy.DoLogic(deltaTime);
9 replies
CC#
Created by ChoppySloppy542 on 10/18/2024 in #help
The Given key was not present in the dictionary
$codegif
9 replies
CC#
Created by ChoppySloppy542 on 6/10/2023 in #help
✅ im new and i dont get this
actually imma go to sleep for the night
37 replies
CC#
Created by ChoppySloppy542 on 6/10/2023 in #help
✅ im new and i dont get this
37 replies
CC#
Created by ChoppySloppy542 on 6/10/2023 in #help
✅ im new and i dont get this
im getting this error cant seem to figure it out
37 replies
CC#
Created by ChoppySloppy542 on 6/10/2023 in #help
✅ im new and i dont get this
i fixed the classes error
37 replies
CC#
Created by ChoppySloppy542 on 6/10/2023 in #help
✅ im new and i dont get this
sfso is a easy fix
37 replies
CC#
Created by ChoppySloppy542 on 6/10/2023 in #help
✅ im new and i dont get this
turns out im not that smart i watched a couple of guides but i cant seem to fix override and inheritance
37 replies
CC#
Created by ChoppySloppy542 on 6/10/2023 in #help
✅ im new and i dont get this
ok
37 replies
CC#
Created by ChoppySloppy542 on 6/10/2023 in #help
✅ im new and i dont get this
ok ill try to fix if i cant ill ping you
37 replies
CC#
Created by ChoppySloppy542 on 6/10/2023 in #help
✅ im new and i dont get this
welp that aint good
37 replies
CC#
Created by ChoppySloppy542 on 6/10/2023 in #help
✅ im new and i dont get this
oh shiii i deleted the wrong line
37 replies
CC#
Created by ChoppySloppy542 on 6/10/2023 in #help
✅ im new and i dont get this
can you list them?
37 replies
CC#
Created by ChoppySloppy542 on 6/10/2023 in #help
✅ im new and i dont get this
@Void is a myth can you explain i need to work in a class
37 replies
CC#
Created by ChoppySloppy542 on 6/10/2023 in #help
✅ im new and i dont get this
i opened the error
37 replies
CC#
Created by ChoppySloppy542 on 6/10/2023 in #help
✅ im new and i dont get this
?
37 replies
CC#
Created by ChoppySloppy542 on 6/10/2023 in #help
✅ im new and i dont get this
37 replies
CC#
Created by ChoppySloppy542 on 6/10/2023 in #help
✅ im new and i dont get this
ok
37 replies