Skip to content

Commit

Permalink
v1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
TenDRILLL authored Jul 25, 2023
1 parent a64d0b0 commit 0b5ec68
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 26 deletions.
57 changes: 32 additions & 25 deletions SuperScan/com.github.sekasin.superscan/EventHandler.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Exiled.API.Enums;
using Exiled.API.Features;
Expand Down Expand Up @@ -40,33 +41,39 @@ public EventHandler(Plugin<Config> plugin) {
}

private void Scan() {
Cassie.Clear();
Cassie.Message(prescan, true, false, true);
int[] roles = { 0, 0, 0, 0, 0, 0 };
//SCP, Scientist, FacilityGuard, NTF, ClassD, Chaos
foreach (Player player in Player.List) {
if (player.IsAlive && !player.IsNPC) {
switch (player.Role.Side) {
case Side.Scp:
roles[0]++;
break;
case Side.Mtf:
if (player.Role.Type == RoleTypeId.Scientist) {
roles[1]++;
} else if (player.Role.Type == RoleTypeId.FacilityGuard) {
roles[2]++;
} else {
roles[3]++;
}
break;
case Side.ChaosInsurgency:
if (player.Role.Type == RoleTypeId.ClassD) {
roles[4]++;
} else {
roles[5]++;
}
break;
}
List<Player> alivePlayers = new List<Player>();
foreach (Player player in Player.List) { if (player.IsAlive && !player.IsNPC) alivePlayers.Append(player); }
if (alivePlayers.Count == 0) {
Timing.KillCoroutines(timer);
Timing.KillCoroutines(timer2);
StartScanTimer();
return;
}
Cassie.Clear();
Cassie.Message(prescan, true, false, true);
foreach (Player player in alivePlayers) {
switch (player.Role.Side) {
case Side.Scp:
roles[0]++;
break;
case Side.Mtf:
if (player.Role.Type == RoleTypeId.Scientist) {
roles[1]++;
} else if (player.Role.Type == RoleTypeId.FacilityGuard) {
roles[2]++;
} else {
roles[3]++;
}
break;
case Side.ChaosInsurgency:
if (player.Role.Type == RoleTypeId.ClassD) {
roles[4]++;
} else {
roles[5]++;
}
break;
}
}

Expand Down
2 changes: 1 addition & 1 deletion SuperScan/com.github.sekasin.superscan/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace SuperScan.com.github.sekasin.superscan {
public class SuperScan : Plugin<Config> {
public override string Name => "SuperScan";
public override string Author => "TenDRILLL";
public override Version Version => new Version(1, 0, 0);
public override Version Version => new Version(1, 1, 1);
public EventHandler EventHandler;

public override void OnEnabled() {
Expand Down

0 comments on commit 0b5ec68

Please sign in to comment.