Clean admin.cs

This commit is contained in:
xSprite
2018-10-28 02:01:54 +01:00
parent 49ff5b4e62
commit 87293f30d4

View File

@@ -25,10 +25,76 @@ namespace reallife_gamemode.Server.Commands
{ {
public class Admin : Script public class Admin : Script
{ {
#region Support
[Command("o", "~m~Benutzung: ~s~/o [Nachricht]", GreedyArg = true)]
public void CmdAdminO(Client player, string message)
{
if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true)
{
ChatService.NotAuthorized(player);
return;
}
string publicMessage = "~b~(( " + player.Name + ": " + message + " ))";
NAPI.Chat.SendChatMessageToAll(publicMessage);
}
#endregion
#region ALevel1
#endregion
#region ALevel2
[Command("clothes", "~m~Benutzung: ~s~/clothes [Spieler] [Slot] [Component ID] (Textur)")]
public void CmdAdminClothes(Client player, string name, int slot, int component, int texture = 0)
{
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN2) ?? true)
{
ChatService.NotAuthorized(player);
return;
}
Client target = ClientService.GetClientByName(name);
if (target == null || !target.IsLoggedIn())
{
ChatService.PlayerNotFound(player);
return;
}
target.SetClothes(slot, component, texture);
}
[Command("props", "~m~Benutzung: ~s~/props [Slot] [Component ID] (Textur)")]
public void CmdAdminProps(Client player, string name, int slot, int component, int texture = 0)
{
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN2) ?? true)
{
ChatService.NotAuthorized(player);
return;
}
Client target = ClientService.GetClientByName(name);
if (target == null || !target.IsLoggedIn())
{
ChatService.PlayerNotFound(player);
return;
}
target.SetAccessories(slot, component, texture);
}
#endregion
#region ALevel3
#endregion
#region ALevel1337
[Command("vmod", "~m~Benutzung: ~s~/vmod [Slot] [Mod ID]")] [Command("vmod", "~m~Benutzung: ~s~/vmod [Slot] [Mod ID]")]
public void CmdAdminVmod(Client player, int slot, int mod) public void CmdAdminVmod(Client player, int slot, int mod)
{ {
if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true) if (!player.GetUser()?.IsAdmin(AdminLevel.HEADADMIN) ?? true)
{ {
ChatService.NotAuthorized(player); ChatService.NotAuthorized(player);
return; return;
@@ -43,43 +109,12 @@ namespace reallife_gamemode.Server.Commands
if (mod == -1) player.Vehicle.RemoveMod(slot); if (mod == -1) player.Vehicle.RemoveMod(slot);
else player.Vehicle.SetMod(slot, mod); else player.Vehicle.SetMod(slot, mod);
} }
#endregion
[Command("clothes", "~m~Benutzung: ~s~/clothes [Slot] [Component ID] (Textur)")]
public void CmdAdminClothes(Client player, int slot, int component, int texture = 0)
{
if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true)
{
ChatService.NotAuthorized(player);
return;
}
player.SetClothes(slot, component, texture); #region ALevel1338
} #endregion
[Command("props", "~m~Benutzung: ~s~/props [Slot] [Component ID] (Textur)")]
public void CmdAdminProps(Client player, int slot, int component, int texture = 0)
{
if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true)
{
ChatService.NotAuthorized(player);
return;
}
player.SetAccessories(slot, component, texture);
}
[Command("o", "~m~Benutzung: ~s~/o [Nachricht]", GreedyArg = true)]
public void CmdAdminO(Client player, string message)
{
if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true)
{
ChatService.NotAuthorized(player);
return;
}
string publicMessage = "~b~(( " + player.Name + ": " + message + " ))";
NAPI.Chat.SendChatMessageToAll(publicMessage);
}
[Command("veh", "~m~Benutzung: ~s~/veh [Fahrzeug] (Farbe 1) (Farbe 2)")] [Command("veh", "~m~Benutzung: ~s~/veh [Fahrzeug] (Farbe 1) (Farbe 2)")]
public void CmdAdminVeh(Client player, string hash, int color1 = 111, int color2 = 111) public void CmdAdminVeh(Client player, string hash, int color1 = 111, int color2 = 111)