Skip to content

Commit 8c2a3b1

Browse files
authored
Add files via upload
1 parent 3a1b619 commit 8c2a3b1

File tree

18 files changed

+1093
-0
lines changed

18 files changed

+1093
-0
lines changed

SCP-600V/API/Role/RoleGet.cs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
using Exiled.API.Features;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
5+
namespace SCP_600V.API.Role
6+
{
7+
/// <summary>
8+
/// allows you to get information on certain criteria about the roles on the server
9+
/// </summary>
10+
public class RoleGet
11+
{
12+
/// <summary>
13+
/// gets a list of players with the Breeder role on the server
14+
/// </summary>
15+
/// <returns>Player list</returns>
16+
public static List<Player> Scp600Players() => Player.List.Where(x => x.SessionVariables.ContainsKey("IsSCP600")).ToList();
17+
/// <summary>
18+
/// gets a list of players who have the Serpent's Hand role on the server
19+
/// </summary>
20+
/// <returns>Player list</returns>
21+
public static List<Player> SHPlayers() => Player.List.Where(x => x.SessionVariables.ContainsKey("IsSH")).ToList();
22+
/// <summary>
23+
/// gets a list of players with the role of Mask of Obsession on the server
24+
/// </summary>
25+
/// <returns>Player list</returns>
26+
public static List<Player> Scp035Players() => Player.List.Where(x => x.SessionVariables.ContainsKey("IsScp035")).ToList();
27+
/// <summary>
28+
/// Gets a player and defines their role
29+
/// </summary>
30+
/// <param name="player">Player to check</param>
31+
/// <returns>returns true if the player is SCP-600 or not null</returns>
32+
public static bool IsScp600(Player player)
33+
{
34+
if (player != null & player.SessionVariables.ContainsKey("IsSCP600"))
35+
{
36+
return true;
37+
}
38+
else
39+
{
40+
return false;
41+
}
42+
}
43+
}
44+
}

SCP-600V/API/Role/TeamGet.cs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using Exiled.API.Features;
2+
using PlayerRoles;
3+
using System.Linq;
4+
5+
namespace SCP_600V.API.Role
6+
{
7+
/// <summary>
8+
/// Allows you to get information about the Team on the server
9+
/// </summary>
10+
public class TeamGet
11+
{
12+
/// <summary>
13+
/// Allows you to get the number of people who do not have the role Breeder on the server
14+
/// </summary>
15+
/// <param name="team">Team to check</param>
16+
/// <returns>returns the number of players in the team excluding scp</returns>
17+
public static int AmountTeamNotScp(Team team) => Player.List.Where(x => x.SessionVariables.ContainsKey("IsSCP600") == false & x.Role.Team == team).ToList().Count();
18+
/// <summary>
19+
/// Determine if a player who is an SCP is in the team
20+
/// </summary>
21+
/// <param name="team">Team to check</param>
22+
/// <returns>returns true if the SCP player is on the team</returns>
23+
public static bool ScpInTeam(Team team)
24+
{
25+
int NotScp = AmountTeamNotScp(team);
26+
int all = Player.List.Where(x => x.Role.Team == team).ToList().Count();
27+
if (NotScp != all)
28+
{
29+
return true;
30+
}
31+
else
32+
{
33+
return false;
34+
}
35+
}
36+
}
37+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
using System;
2+
using Exiled.API.Features;
3+
using CommandSystem;
4+
using Exiled.Permissions.Extensions;
5+
using System.Text;
6+
7+
namespace SCP_600V.Command
8+
{
9+
[CommandHandler(typeof(RemoteAdminCommandHandler))]
10+
internal class GetPlayerAsScp600 : ICommand
11+
{
12+
public string Command { get; set; } = "ListScp600Player";
13+
14+
public string[] Aliases { get; set; } = { "LSP6", "li6" };
15+
16+
public string Description { get; set; } = "Get player list playing as scp-600v now";
17+
18+
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
19+
{
20+
Player player = Player.Get(sender);
21+
if (player != null)
22+
{
23+
if (player.CheckPermission("s6.GetPlayers"))
24+
{
25+
StringBuilder a = new StringBuilder();
26+
foreach (Player ply in Player.List)
27+
{
28+
if (ply.SessionVariables.ContainsKey("IsSCP600"))
29+
{
30+
a.Append(ply.Nickname + ", ");
31+
}
32+
}
33+
response = $"{Sai.Instance.Config.ListGetted.Replace("{name}", a.ToString())}";
34+
return true;
35+
}
36+
else
37+
{
38+
response = Sai.Instance.Config.PermissionDenied;
39+
return false;
40+
}
41+
}
42+
response = "? i have not get info";
43+
return false;
44+
}
45+
}
46+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
using System;
2+
using Exiled.API.Features;
3+
using CommandSystem;
4+
using Exiled.Permissions.Extensions;
5+
using System.Text;
6+
7+
namespace SCP_600V.Command
8+
{
9+
internal class GetSessionVariables
10+
{
11+
[CommandHandler(typeof(RemoteAdminCommandHandler))]
12+
internal class Spawn : ICommand
13+
{
14+
public string Command { get; set; } = "Vars";
15+
16+
public string[] Aliases { get; set; } = { "vars", "servervars" };
17+
18+
public string Description { get; set; } = "Get player sessions variables";
19+
20+
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
21+
{
22+
Player send = Player.Get(sender);
23+
Player ply = Player.Get(arguments.At(0));
24+
if (send.CheckPermission("s6.debug"))
25+
{
26+
if (send == null)
27+
{
28+
response = "Unkown error";
29+
return false;
30+
}
31+
if (send != null)
32+
{
33+
StringBuilder asd = new StringBuilder();
34+
if (ply != null)
35+
{
36+
foreach (string arga in ply.SessionVariables.Keys)
37+
{
38+
asd.Append(arga + ", ");
39+
}
40+
}
41+
else
42+
{
43+
foreach (string arga in send.SessionVariables.Keys)
44+
{
45+
asd.Append(arga + ", ");
46+
}
47+
}
48+
response = asd.ToString();
49+
return true;
50+
}
51+
response = "idk";
52+
return false;
53+
}
54+
else
55+
{
56+
response = Sai.Instance.Config.PermissionDenied;
57+
return false;
58+
}
59+
}
60+
}
61+
}
62+
}

SCP-600V/Command/MaxHealth.cs

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
using System;
2+
using Exiled.API.Features;
3+
using CommandSystem;
4+
using Exiled.Permissions.Extensions;
5+
using Exiled.CustomRoles.API.Features;
6+
using SCP_600V.Extension;
7+
8+
namespace SCP_600V.Command
9+
{
10+
[CommandHandler(typeof(RemoteAdminCommandHandler))]
11+
internal class MaxHealth : ICommand
12+
{
13+
public string Command { get; set; } = "MHP";
14+
15+
public string[] Aliases { get; set; } = { "mhp", "s6mhp" };
16+
17+
public string Description { get; set; } = "Chenge your maxhealt values\n<amount> <userID>";
18+
19+
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
20+
{
21+
Player ply = Player.Get(sender);
22+
if (ply != null)
23+
{
24+
if (ply.CheckPermission("s6.ChengeMHP"))
25+
{
26+
if (CustomRole.Get(typeof(Scp600CotumRoleBase)).Check(ply))
27+
{
28+
if (arguments.Count == 0)
29+
{
30+
response = Sai.Instance.Config.MhpHealArgEr;
31+
return false;
32+
}
33+
else
34+
{
35+
try
36+
{
37+
if (arguments.Count == 1)
38+
{
39+
int num = int.Parse(arguments.At(0));
40+
ply.MaxHealth = num;
41+
ply.Health = num;
42+
response = $"{Sai.Instance.Config.MhpChenged.Replace("{amount}", num.ToString())}";
43+
return true;
44+
}
45+
if (arguments.Count == 2)
46+
{
47+
Player who = Player.Get(arguments.At(1));
48+
if (who != null)
49+
{
50+
int num = int.Parse(arguments.At(0));
51+
who.MaxHealth = num;
52+
who.Health = num;
53+
response = $"{Sai.Instance.Config.MhpChenged.Replace("{amount}", num.ToString())}";
54+
return true;
55+
}
56+
if (who == null)
57+
{
58+
response = Sai.Instance.Config.PlayerNF;
59+
return false;
60+
}
61+
}
62+
}
63+
catch
64+
{
65+
response = Sai.Instance.Config.MhpHealArgEr;
66+
return false;
67+
}
68+
}
69+
}
70+
else
71+
{
72+
response = "Your are not scp600 now";
73+
return false;
74+
}
75+
}
76+
else
77+
{
78+
response = Sai.Instance.Config.PermissionDenied;
79+
return false;
80+
}
81+
}
82+
response = "?";
83+
return false;
84+
}
85+
}
86+
}

SCP-600V/Command/PermissionList.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System;
2+
using Exiled.API.Features;
3+
using CommandSystem;
4+
using Exiled.Permissions.Extensions;
5+
6+
namespace SCP_600V.Command
7+
{
8+
[CommandHandler(typeof(RemoteAdminCommandHandler))]
9+
internal class PermissionList : ICommand
10+
{
11+
public string Command { get; set; } = "PermissionList";
12+
13+
public string[] Aliases { get; set; } = { "permli", "permission" };
14+
15+
public string Description { get; set; } = "displays a list of permissions for commands";
16+
17+
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
18+
{
19+
response = "s6.SelfSpawn - can an admin give himself the scp-600 role\ns6.ChengeMHP - can admin change max health while playing as scp-600\ns6.debug - can admin get player's session variables\ns6.GetPlayers - can the admin find out the list of players playing for scp-600";
20+
return true;
21+
}
22+
}
23+
}

SCP-600V/Command/Spawn.cs

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
using System;
2+
using Exiled.API.Features;
3+
using CommandSystem;
4+
using Exiled.Permissions.Extensions;
5+
using Exiled.CustomRoles.API.Features;
6+
using SCP_600V.Extension;
7+
using SCP_600V.API.Role;
8+
9+
namespace SCP_600V.Command
10+
{
11+
[CommandHandler(typeof(RemoteAdminCommandHandler))]
12+
internal class Spawn : ICommand
13+
{
14+
public string Command { get; set; } = "SpawnScp600";
15+
16+
public string[] Aliases { get; set; } = { "S600", "sp6", "scp600" };
17+
18+
public string Description { get; set; } = "Spawn your as scp-600v\nsp6 <userID>";
19+
20+
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
21+
{
22+
Player writer = Player.Get(sender);
23+
if (writer != null)
24+
{
25+
if (writer.CheckPermission("s6.SelfSpawn"))
26+
{
27+
if (arguments.Count == 0)
28+
{
29+
if (writer.Role.Type != PlayerRoles.RoleTypeId.Spectator)
30+
{
31+
if (RoleGet.IsScp600(writer))
32+
{
33+
CustomRole.Get(typeof(Scp600CotumRoleBase)).AddRole(writer);
34+
response = "Your are forced class to SCP-600V";
35+
return true;
36+
}
37+
else
38+
{
39+
response = "? your are scp-600 now";
40+
return false;
41+
}
42+
}
43+
if (writer.Role.Type == PlayerRoles.RoleTypeId.Spectator)
44+
{
45+
response = Sai.Instance.Config.SpawnCommandEr;
46+
return false;
47+
}
48+
}
49+
else
50+
{
51+
Player neded = Player.Get(arguments.At(0));
52+
if (neded != null)
53+
{
54+
if (neded.Role.Type == PlayerRoles.RoleTypeId.Spectator)
55+
{
56+
response = Sai.Instance.Config.SpawnCommandEr;
57+
return false;
58+
}
59+
if (RoleGet.IsScp600(neded))
60+
{
61+
CustomRole.Get(typeof(Scp600CotumRoleBase)).AddRole(neded);
62+
response = $"Player {neded.Nickname} spawned as SCP-600V";
63+
return true;
64+
}
65+
else
66+
{
67+
response = "? is scp-600 playing now";
68+
return false;
69+
}
70+
}
71+
if (neded == null)
72+
{
73+
response = Sai.Instance.Config.PlayerNF;
74+
return false;
75+
}
76+
}
77+
}
78+
else
79+
{
80+
response = Sai.Instance.Config.PermissionDenied;
81+
return false;
82+
}
83+
}
84+
response = "Idk";
85+
return false;
86+
}
87+
}
88+
}

0 commit comments

Comments
 (0)