Skip to content
This repository has been archived by the owner on Jul 8, 2021. It is now read-only.

Commit

Permalink
Patch for badgetext error
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMith committed Feb 24, 2019
1 parent c5ae0ed commit 3e8327c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion SCP-343/SCP_343.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace SCP_343
name = "SCP-343",
description = "SCP-343 is a passive immortal D-Class Personnel. He spawns with one Flashlight and any weapon he picks up is morphed to prevent violence. He seeks to help out who he deems worthy.",
id = "Mith.SCP-343",
version = "1.3.6",
version = "1.3.7",
SmodMajor = 3,
SmodMinor = 3,
SmodRevision = 0
Expand Down
11 changes: 10 additions & 1 deletion SCP-343/SCP_343Commands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,21 @@ public string[] OnCall(ICommandSender sender, string[] args)
{
Playa.ChangeRole(Smod2.API.Role.CLASSD, true, true, true);
Playa.GiveItem(ItemType.FLASHLIGHT);

if (EventLogic._343Config.SCP343_HP != -1)
{
Playa.SetHealth(EventLogic._343Config.SCP343_HP);
}

if (Playa.GetUserGroup().BadgeText == null)
{
SCP343.Active343AndBadgeDict.Add(Playa.SteamId, new SCP343.PlayerInfo("", ""));
}
else
{
SCP343.Active343AndBadgeDict.Add(Playa.SteamId, new SCP343.PlayerInfo(Playa.GetUserGroup().BadgeText, Playa.GetUserGroup().Color));
}

SCP343.Active343AndBadgeDict.Add(Playa.SteamId, new SCP343.PlayerInfo(Playa.GetUserGroup().BadgeText, Playa.GetUserGroup().Color));

Playa.SetRank("red", "SCP-343");
return new string[] { "Made " + Playa.Name + " SCP343!" };
Expand Down
9 changes: 8 additions & 1 deletion SCP-343/SCP_343EventLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,14 @@ public void OnRoundStart(RoundStartEvent ev)
if (DClassList.Count > 0 && plugin.pluginManager.Server.GetPlayers().Count > 2)
{
Player TheChosenOne = DClassList[RNG.Next(DClassList.Count)];
SCP343.Active343AndBadgeDict.Add(TheChosenOne.SteamId, new SCP343.PlayerInfo(TheChosenOne.GetUserGroup().BadgeText, TheChosenOne.GetUserGroup().Color));
if(TheChosenOne.GetUserGroup().BadgeText == null)
{
SCP343.Active343AndBadgeDict.Add(TheChosenOne.SteamId, new SCP343.PlayerInfo("", ""));
}
else
{
SCP343.Active343AndBadgeDict.Add(TheChosenOne.SteamId, new SCP343.PlayerInfo(TheChosenOne.GetUserGroup().BadgeText, TheChosenOne.GetUserGroup().Color));
}
TheChosenOne.GiveItem(ItemType.FLASHLIGHT);
if (_343Config.SCP343_HP != -1)
{
Expand Down

0 comments on commit 3e8327c

Please sign in to comment.