Пример #1
0
 public void OnAssignTeam(PlayerInitialAssignTeamEvent ev)
 {
     /// <summary>
     /// Called when a team is picked for a player. Nothing is assigned to the player, but you can change what team the player will spawn as.
     /// <summary>
     plugin.SendMessageAsync(plugin.GetConfigString("discord_channel_onassignteam"), ev.Player.Name + " (" + ev.Player.SteamId + plugin.MultiLanguage(31) + ev.Team + ".");
 }
Пример #2
0
 void IEventHandlerInitialAssignTeam.OnAssignTeam(PlayerInitialAssignTeamEvent ev)
 {
     send(ev, new IdMapping()
          .appendId(Lib.PLAYER_ID, ev.Player)
          .appendId(Lib.PLAYER_EVENT_SCPDATA_ID, ev.Player.Scp079Data)
          .appendId(Lib.PLAYER_EVENT_TEAM_ROLE_ID, ev.Player.TeamRole)
          );
 }
Пример #3
0
 public void OnAssignTeam(PlayerInitialAssignTeamEvent ev)
 {
     if (GamemodeManager.GamemodeManager.GetCurrentMode().Equals(plugin))
     {
         if (ev.Team == Team.CHAOS_INSURGENCY)
         {
             ev.Team = Team.NINETAILFOX;
         }
     }
 }
Пример #4
0
 public void OnAssignTeam(PlayerInitialAssignTeamEvent ev)
 {
     if (plugin.activated)
     {
         if (plugin.Server.NumPlayers > 3)
         {
             plugin.Debug("Enough players for randomization.");
             if (invalidTeams.Contains(ev.Team))
             {
                 plugin.Debug(ev.Player.Name + " is in an invalid team. Reassigning.");
                 var random = new Random().Next(0, 1);
                 if (random == 0)
                 {
                     ev.Team = Team.CLASSD;
                     plugin.Debug(ev.Player.Name + " is Class-D.");
                 }
                 else if (random == 1)
                 {
                     ev.Team = Team.NINETAILFOX;
                     plugin.Debug(ev.Player.Name + " is MTF.");
                 }
                 else
                 {
                     plugin.Error("!! RANDOM WAS NOT 0 OR 1! THE UNIVERSE IS BROKEN! !!");
                 }
             }
             else
             {
                 plugin.Debug(ev.Player.Name + " is not in an invalid team. Not reassigning.");
             }
         }
         else
         {
             plugin.Debug("Not enough players for randomization. Brute-force it.");
             if (!alreadyDClass)
             {
                 ev.Team       = Team.CLASSD;
                 alreadyDClass = true;
                 plugin.Debug(ev.Player.Name + " is Class-D.");
             }
             else
             {
                 ev.Team = Team.NINETAILFOX;
                 plugin.Debug(ev.Player.Name + " is MTF.");
             }
         }
     }
 }
 public void OnAssignTeam(PlayerInitialAssignTeamEvent ev)
 {
     if (GamemodeManager.GamemodeManager.GetCurrentMode().Equals(plugin))
     {
         if ((ev.Team != Team.CLASSD) && (ev.Team != Team.SCP))
         {
             if ((ev.Team == Team.CHAOS_INSURGENCY) || (ev.Team == Team.NINETAILFOX))
             {
                 ev.Team = Team.SCP;
                 ev.Player.Teleport(plugin.pluginManager.Server.Map.GetRandomSpawnPoint(Role.SCP_173));
                 ev.Player.AddHealth(300000);
             }
             if ((ev.Team != Team.NINETAILFOX) || (ev.Team != Team.CHAOS_INSURGENCY))
             {
                 ev.Team = Team.CLASSD;
                 ev.Player.Teleport(plugin.pluginManager.Server.Map.GetRandomSpawnPoint(Role.CLASSD));
             }
         }
     }
 }
Пример #6
0
        public void OnAssignTeam(PlayerInitialAssignTeamEvent ev)
        {
            /// <summary>
            /// Called when a team is picked for a player. Nothing is assigned to the player, but you can change what team the player will spawn as.
            /// <summary>
            if (ev.Team == Smod2.API.Team.NONE)
            {
                return;
            }

            Dictionary <string, string> variables = new Dictionary <string, string>
            {
                { "ipaddress", ev.Player.IpAddress },
                { "name", ev.Player.Name },
                { "playerid", ev.Player.PlayerId.ToString() },
                { "steamid", ev.Player.SteamId },
                { "class", ev.Player.TeamRole.Role.ToString() },
                { "team", ev.Team.ToString() }
            };

            plugin.SendMessage(Config.GetArray("channels.onassignteam"), "player.onassignteam", variables);
        }