Add /gotoxyz Command, Add /ipl Command to manage IPLs

This commit is contained in:
Lennart Kampshoff
2018-09-19 13:53:17 +02:00
parent 3c89b57665
commit e7847da1fc

View File

@@ -29,7 +29,7 @@ namespace reallife_gamemode.Server.Commands
NAPI.Chat.SendChatMessageToAll(publicMessage); 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, VehicleHash hash, int color1 = 111, int color2 = 111) public void CmdAdminVeh(Client player, VehicleHash hash, int color1 = 111, int color2 = 111)
{ {
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true) if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
@@ -88,7 +88,7 @@ namespace reallife_gamemode.Server.Commands
player.Vehicle.Delete(); player.Vehicle.Delete();
} }
[Command("goto", "~m~Benutzung:~s~ /goto [Name]")] [Command("goto", "~m~Benutzung: ~s~/goto [Name]")]
public void CmdAdminGoto(Client player, string name) public void CmdAdminGoto(Client player, string name)
{ {
if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true) if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true)
@@ -105,5 +105,44 @@ namespace reallife_gamemode.Server.Commands
return; return;
} }
} }
[Command("gotoxyz", "~m~Benutzung: ~s~/gotoxyz [X] [Y] [Z]")]
public void CmdAdminGotoxyz(Client player, float x, float y, float z)
{
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
{
ChatService.NotAuthorized(player);
return;
}
player.Position = new Vector3(x, y, z);
}
[Command("ipl", "~m~Benutzung: ~s~/ipl [Load / Remove] [Name]")]
public void CmdAdminIpl(Client player, string option, string name)
{
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
{
ChatService.NotAuthorized(player);
return;
}
option = option.ToLower();
if(option == "load")
{
NAPI.World.RequestIpl(name);
player.SendChatMessage("~g~Das IPL ~s~" + name + " ~g~wurde erfolgreich geladen");
}
else if(option == "remove")
{
NAPI.World.RemoveIpl(name);
player.SendChatMessage("~g~Das IPL ~s~" + name + " ~g~wurde erfolgreich entladen");
}
else
{
player.SendChatMessage("~m~Benutzung: ~s~/ipl [Load / Remove] [Name]");
}
}
} }
} }