Add Header Comments, Add 'null'-Checks on Commands
This commit is contained in:
@@ -19,7 +19,7 @@ namespace reallife_gamemode.Server.Commands
|
||||
[Command("o", "~m~Benutzung: ~s~/o [Nachricht]", GreedyArg = true)]
|
||||
public void CmdAdminO(Client player, string message)
|
||||
{
|
||||
if (!player.GetUser().IsAdmin(AdminLevel.SUPPORTER))
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true)
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
@@ -32,15 +32,13 @@ namespace reallife_gamemode.Server.Commands
|
||||
[Command("veh", "~m~Benutzung:~s~ /veh [Fahrzeug] (Farbe 1) (Farbe 2)")]
|
||||
public void CmdAdminVeh(Client player, VehicleHash hash, int color1 = 111, int color2 = 111)
|
||||
{
|
||||
// Alternative: siehe O Chat
|
||||
int playerAdminLevel = 1;
|
||||
if (playerAdminLevel < /* Benötigtes Level */ 1)
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
}
|
||||
|
||||
if(player.IsInVehicle) // Man darf keine Autos erstellen, wenn man selbst in einem sitzt (verhindert Bugs)
|
||||
if (player.IsInVehicle) // Man darf keine Autos erstellen, wenn man selbst in einem sitzt (verhindert Bugs)
|
||||
{
|
||||
player.SendChatMessage("~r~[FEHLER]~s~ Du sitzt momentan schon in einem Fahrzeug.");
|
||||
return;
|
||||
@@ -54,7 +52,7 @@ namespace reallife_gamemode.Server.Commands
|
||||
[Command("fixveh")]
|
||||
public void CmdAdminFixveh(Client player)
|
||||
{
|
||||
if (!player.GetUser().IsAdmin(AdminLevel.SUPPORTER))
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
@@ -72,8 +70,7 @@ namespace reallife_gamemode.Server.Commands
|
||||
[Command("delveh")]
|
||||
public void CmdAdminDelveh(Client player)
|
||||
{
|
||||
int playerAdminLevel = 1;
|
||||
if (playerAdminLevel < /* Benötigtes Level */ 1)
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
@@ -94,7 +91,7 @@ namespace reallife_gamemode.Server.Commands
|
||||
[Command("goto", "~m~Benutzung:~s~ /goto [Name]")]
|
||||
public void CmdAdminGoto(Client player, string name)
|
||||
{
|
||||
if (!player.GetUser().IsAdmin(AdminLevel.SUPPORTER))
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true)
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user