added up down lt and rt
This commit is contained in:
@@ -569,7 +569,8 @@ namespace reallife_gamemode.Server.Commands
|
||||
}
|
||||
|
||||
List<Client> playerlist = NAPI.Pools.GetAllPlayers();
|
||||
foreach (Client currentPlayer in playerlist) {
|
||||
foreach (Client currentPlayer in playerlist)
|
||||
{
|
||||
if (currentPlayer.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? false)
|
||||
{
|
||||
NAPI.Chat.SendChatMessageToPlayer(currentPlayer, "~r~Admin " + NAPI.Player.GetPlayerName(player) + "~w~: " + message);
|
||||
@@ -595,7 +596,6 @@ namespace reallife_gamemode.Server.Commands
|
||||
if (currentPlayer.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? false)
|
||||
{
|
||||
NAPI.Chat.SendChatMessageToPlayer(player, "~w~" + NAPI.Player.GetPlayerName(currentPlayer));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -615,10 +615,11 @@ namespace reallife_gamemode.Server.Commands
|
||||
|
||||
if (!weatherBefore.Equals(weatherAfter))
|
||||
{
|
||||
NAPI.Chat.SendChatMessageToPlayer(player, "~w~Weather changed to " + NAPI.World.GetWeather());
|
||||
} else
|
||||
NAPI.Chat.SendChatMessageToPlayer(player, "~w~Wetter geändert: " + NAPI.World.GetWeather());
|
||||
}
|
||||
else
|
||||
{
|
||||
NAPI.Chat.SendChatMessageToPlayer(player, "~w~Unable to change weather");
|
||||
NAPI.Chat.SendChatMessageToPlayer(player, "~w~Wetter konnte nicht geändert werden");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -695,5 +696,94 @@ namespace reallife_gamemode.Server.Commands
|
||||
NAPI.Chat.SendChatMessageToAll("");
|
||||
}
|
||||
}
|
||||
|
||||
[Command("up", "~m~Benutzung: ~s~/up [Wert]")]
|
||||
public void CmdAdminUp(Client player, int value = 5)
|
||||
{
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
}
|
||||
|
||||
Vector3 playerPosition = new Vector3(player.Position.X, player.Position.Y, player.Position.Z + value);
|
||||
player.Position = playerPosition;
|
||||
}
|
||||
|
||||
[Command("dn", "~m~Benutzung: ~s~/dn [Wert]")]
|
||||
public void CmdAdminDn(Client player, int value = 5)
|
||||
{
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
}
|
||||
|
||||
Vector3 playerPosition = new Vector3(player.Position.X, player.Position.Y, player.Position.Z - value);
|
||||
player.Position = playerPosition;
|
||||
}
|
||||
|
||||
[Command("rt", "~m~Benutzung: ~s~/rt [Wert]")]
|
||||
public void CmdAdminRt(Client player, int value = 5)
|
||||
{
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
}
|
||||
|
||||
float playerHeading = player.Heading;
|
||||
|
||||
if (playerHeading < 45 || playerHeading >= 315)
|
||||
{
|
||||
Vector3 playerPosition = new Vector3(player.Position.X + value, player.Position.Y, player.Position.Z);
|
||||
player.Position = playerPosition;
|
||||
|
||||
}
|
||||
else if (playerHeading < 315 && playerHeading >= 225)
|
||||
{
|
||||
Vector3 playerPosition = new Vector3(player.Position.X, player.Position.Y - value, player.Position.Z);
|
||||
player.Position = playerPosition;
|
||||
}
|
||||
else if (playerHeading >= 135 && playerHeading < 225)
|
||||
{
|
||||
Vector3 playerPosition = new Vector3(player.Position.X - value, player.Position.Y, player.Position.Z);
|
||||
player.Position = playerPosition;
|
||||
}
|
||||
else if (playerHeading >= 45 && playerHeading < 135)
|
||||
{
|
||||
Vector3 playerPosition = new Vector3(player.Position.X, player.Position.Y + value, player.Position.Z);
|
||||
player.Position = playerPosition;
|
||||
}
|
||||
}
|
||||
|
||||
[Command("lt", "~m~Benutzung: ~s~/lt [Wert]")]
|
||||
public void CmdAdminLt(Client player, int value = 5)
|
||||
{
|
||||
|
||||
float playerHeading = player.Heading;
|
||||
|
||||
if (playerHeading < 45 || playerHeading >= 315)
|
||||
{
|
||||
Vector3 playerPosition = new Vector3(player.Position.X - value, player.Position.Y, player.Position.Z);
|
||||
player.Position = playerPosition;
|
||||
|
||||
}
|
||||
else if (playerHeading < 315 && playerHeading >= 225)
|
||||
{
|
||||
Vector3 playerPosition = new Vector3(player.Position.X, player.Position.Y + value, player.Position.Z);
|
||||
player.Position = playerPosition;
|
||||
}
|
||||
else if (playerHeading >= 135 && playerHeading < 225)
|
||||
{
|
||||
Vector3 playerPosition = new Vector3(player.Position.X + value, player.Position.Y, player.Position.Z);
|
||||
player.Position = playerPosition;
|
||||
}
|
||||
else if (playerHeading >= 45 && playerHeading < 135)
|
||||
{
|
||||
Vector3 playerPosition = new Vector3(player.Position.X, player.Position.Y - value, player.Position.Z);
|
||||
player.Position = playerPosition;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user