Hey guys! I have installed Team Battlefield plugins on my server. The only issue I have is, when I place a bag and want to respawn in the bag, it respawns me back to lobby, not the bag. Is there any possible way, I could make it that If I click on the bag it respawns me on the bag, and If click Random Respawn button, it respawns me in the lobby. Thanks.

Code:

 

 private void OnPlayerRespawned(BasePlayer player) 
        {
            if (UseTB)
            {
                if (player.GetComponent<TBPlayer>())
                {
                    Team team = player.GetComponent<TBPlayer>().team;
                    player.inventory.Strip();
                    if (team != Team.SPECTATOR)
                    {
                        GivePlayerWeapons(player);
                        GivePlayerGear(player, team);

                        object newpos = null;
						
						

                        if (team == Team.A) newpos = Spawns.Call("GetRandomSpawn", new object[] { configData.TeamA.Spawnfile });
                        else if (team == Team.B) newpos = Spawns.Call("GetRandomSpawn", new object[] { configData.TeamB.Spawnfile });
						else if (team == Team.C) newpos = Spawns.Call("GetRandomSpawn", new object[] { configData.TeamC.Spawnfile });
                        else if (team == Team.ADMIN && !string.IsNullOrEmpty(configData.Admin.Spawnfile)) newpos = Spawns.Call("GetRandomSpawn", new object[] { configData.Admin.Spawnfile });

                        if (newpos is Vector3)
                            MovePlayerPosition(player, (Vector3)newpos);
                    }
                }
                else OnPlayerInit(player);
            }           
        }