added commands: a, team, setweather
This commit is contained in:
@@ -8,7 +8,7 @@ using reallife_gamemode.Server.Util;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @overview Life of German Reallife - Admin Commands (Admin.cs)
|
* @overview Life of German Reallife - Admin Commands (Admin.cs)
|
||||||
* @author VegaZ, hydrant
|
* @author VegaZ, hydrant, balbo
|
||||||
* @copyright (c) 2008 - 2018 Life of German
|
* @copyright (c) 2008 - 2018 Life of German
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -199,5 +199,71 @@ namespace reallife_gamemode.Server.Commands
|
|||||||
|
|
||||||
target.GiveWeapon(wHash, ammo);
|
target.GiveWeapon(wHash, ammo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Command("a", "~m~Benutzung: ~s~/a [Nachricht]")]
|
||||||
|
public void CmdAdminA(Client player, string message)
|
||||||
|
{
|
||||||
|
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
|
||||||
|
{
|
||||||
|
ChatService.NotAuthorized(player);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Client> playerlist = NAPI.Pools.GetAllPlayers();
|
||||||
|
foreach (Client currentPlayer in playerlist) {
|
||||||
|
if (currentPlayer.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
|
||||||
|
{
|
||||||
|
NAPI.Chat.SendChatMessageToPlayer(currentPlayer, "~b~A-Chat: ~w~" + message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[Command("team", "~m~Benutzung: ~s~/team")]
|
||||||
|
public void CmdAdminTeam(Client player)
|
||||||
|
{
|
||||||
|
if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true)
|
||||||
|
{
|
||||||
|
ChatService.NotAuthorized(player);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
NAPI.Chat.SendChatMessageToPlayer(player, "Online Teammitglieder:");
|
||||||
|
|
||||||
|
List<Client> playerlist = NAPI.Pools.GetAllPlayers();
|
||||||
|
foreach (Client currentPlayer in playerlist)
|
||||||
|
{
|
||||||
|
if (currentPlayer.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true)
|
||||||
|
{
|
||||||
|
NAPI.Chat.SendChatMessageToPlayer(player, "~w~" + NAPI.Player.GetPlayerName(currentPlayer));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Command("setweather", "~m~Benutzung: ~s~/setweather [WEATHER]")]
|
||||||
|
public void CmdAdminSetweather(Client player, string weather)
|
||||||
|
{
|
||||||
|
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
|
||||||
|
{
|
||||||
|
ChatService.NotAuthorized(player);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Weather weatherBefore = NAPI.World.GetWeather();
|
||||||
|
NAPI.World.SetWeather(weather);
|
||||||
|
Weather weatherAfter = NAPI.World.GetWeather();
|
||||||
|
|
||||||
|
if (!weatherBefore.Equals(weatherAfter))
|
||||||
|
{
|
||||||
|
NAPI.Chat.SendChatMessageToPlayer(player, "~w~Weather changed to " + NAPI.World.GetWeather()));
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
NAPI.Chat.SendChatMessageToPlayer(player, "~w~Unable to change weather");
|
||||||
|
}
|
||||||
|
|
||||||
|
player.Vehicle.PrimaryColor = 1;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user