Add Admin Check, Add AdminLevel Column in database
This commit is contained in:
@@ -2,32 +2,24 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using GTANetworkAPI;
|
||||
using reallife_gamemode.Server.Extensions;
|
||||
using reallife_gamemode.Server.Services;
|
||||
using reallife_gamemode.Server.Util;
|
||||
|
||||
namespace reallife_gamemode.Server.Commands
|
||||
{
|
||||
public class Admin : Script
|
||||
{
|
||||
/**
|
||||
* @overview Life of German Reallife - Admin.cs
|
||||
* @overview Life of German Reallife - Admin Commands (Admin.cs)
|
||||
* @author VegaZ, hydrant
|
||||
* @copyright (c) 2008 - 2018 Life of German
|
||||
*/
|
||||
|
||||
[Command("o", "~m~Benutzung: ~s~/o [Nachricht]", GreedyArg = true)]
|
||||
public void CmdAdminOChat(Client player, string message)
|
||||
public void CmdAdminO(Client player, string message)
|
||||
{
|
||||
/*
|
||||
* Alternative:
|
||||
* Account playerAccount = AccountManager.GetAccount(player);
|
||||
* if(!playerAccount.IsAdmin(adminLevel))
|
||||
* {
|
||||
* ChatService.NotAuthorized(player);
|
||||
* return;
|
||||
* }
|
||||
*/
|
||||
int playerAdminLevel = 1;
|
||||
if(playerAdminLevel < /* Benötigtes Level */ 1)
|
||||
if (!player.GetUser().IsAdmin(AdminLevel.SUPPORTER))
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
@@ -62,9 +54,7 @@ namespace reallife_gamemode.Server.Commands
|
||||
[Command("fixveh")]
|
||||
public void CmdAdminFixveh(Client player)
|
||||
{
|
||||
// Alternative: siehe O Chat
|
||||
int playerAdminLevel = 1;
|
||||
if (playerAdminLevel < /* Benötigtes Level */ 1)
|
||||
if (!player.GetUser().IsAdmin(AdminLevel.SUPPORTER))
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
@@ -95,12 +85,28 @@ namespace reallife_gamemode.Server.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: Checken, ob das Fahrzeug in einem System genutzt wird (Fraktions-Autos / Spieler-Auto)
|
||||
* Wenn Ja: Abbrechen und mitteilen, dass man den System-spezifischen Befehl zu nutzen hat
|
||||
*/
|
||||
/* TODO: Checken, ob das Fahrzeug in einem System genutzt wird (Fraktions-Autos / Spieler-Auto)
|
||||
* Wenn Ja: Abbrechen und mitteilen, dass man den System-spezifischen Befehl zu nutzen hat */
|
||||
|
||||
player.Vehicle.Delete();
|
||||
}
|
||||
|
||||
[Command("goto", "~m~Benutzung:~s~ /goto [Name]")]
|
||||
public void CmdAdminGoto(Client player, string name)
|
||||
{
|
||||
if (!player.GetUser().IsAdmin(AdminLevel.SUPPORTER))
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
}
|
||||
|
||||
Client target = ClientService.GetClientByName(name);
|
||||
|
||||
if(target == null)
|
||||
{
|
||||
ChatService.PlayerNotFound(player);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user