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

This commit is contained in:
hydrant
2018-09-19 13:53:17 +02:00
parent f888d6923a
commit d50a2e18cd

View File

@@ -105,5 +105,44 @@ namespace reallife_gamemode.Server.Commands
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]");
}
}
}
}