Add /goto and /save goto
This commit is contained in:
@@ -187,6 +187,20 @@ namespace reallife_gamemode.Server.Commands
|
||||
|
||||
player.SendChatMessage("Position: X Y Z: " + player.Position);
|
||||
}
|
||||
[Command("goto", "~m~Benutzung: ~s~/goto [Ort]")]
|
||||
public void CmdAdminGotoPoint(Client player, string location)
|
||||
{
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
}
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
Entities.GotoPoint p = dbContext.GotoPoints.FirstOrDefault(x => x.Description == location);
|
||||
player.MovePosition(new Vector3(p.X, p.Y, p.Z), 0);
|
||||
}
|
||||
}
|
||||
|
||||
[Command("gotox", "~m~Benutzung: ~s~/gotox [X] [Y] [Z]")]
|
||||
public void CmdAdminGotoxyz(Client player, float x, float y, float z)
|
||||
@@ -630,13 +644,25 @@ namespace reallife_gamemode.Server.Commands
|
||||
target.GetUser().BanPlayer(admin, reason, mins);
|
||||
}
|
||||
|
||||
[Command("save", "~m~Benutzung: ~s~/save [Typ = ~g~Blip, ~r~Marker, Ped, Pickup, TextLabel, ~g~Vehicle, FVehicle, SVehicle")]
|
||||
public void CmdAdminSave(Client player, string typ)
|
||||
[Command("save", "~m~Benutzung: ~s~/save [Typ = ~g~Blip, Goto (X), ~r~Marker, Ped, Pickup, TextLabel, ~g~Vehicle, FVehicle, SVehicle] (Beschreibung) = (X)")]
|
||||
public void CmdAdminSave(Client player, string typ, string description = null)
|
||||
{
|
||||
switch (typ)
|
||||
{
|
||||
case "Blip":
|
||||
player.TriggerEvent("saveBlip");
|
||||
break;
|
||||
case "Goto":
|
||||
if(description == null)
|
||||
{
|
||||
player.SendChatMessage("Für Goto musst du einen dritten Parameter angeben. Beispiel: Ort des Goto-Punktes.");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
SaveManager.SaveGotoPoint(player, description);
|
||||
}
|
||||
|
||||
break;
|
||||
case "Vehicle":
|
||||
if (player.IsInVehicle)
|
||||
|
||||
Reference in New Issue
Block a user