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)
|
||||
* @author VegaZ, hydrant
|
||||
* @author VegaZ, hydrant, balbo
|
||||
* @copyright (c) 2008 - 2018 Life of German
|
||||
*/
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace reallife_gamemode.Server.Commands
|
||||
|
||||
Client target = ClientService.GetClientByName(name);
|
||||
|
||||
if(target == null)
|
||||
if (target == null)
|
||||
{
|
||||
ChatService.PlayerNotFound(player);
|
||||
return;
|
||||
@@ -151,12 +151,12 @@ namespace reallife_gamemode.Server.Commands
|
||||
|
||||
option = option.ToLower();
|
||||
|
||||
if(option == "load")
|
||||
if (option == "load")
|
||||
{
|
||||
NAPI.World.RequestIpl(name);
|
||||
player.SendChatMessage("~g~Das IPL ~s~" + name + " ~g~wurde erfolgreich geladen");
|
||||
}
|
||||
else if(option == "remove")
|
||||
else if (option == "remove")
|
||||
{
|
||||
NAPI.World.RemoveIpl(name);
|
||||
player.SendChatMessage("~g~Das IPL ~s~" + name + " ~g~wurde erfolgreich entladen");
|
||||
@@ -191,7 +191,7 @@ namespace reallife_gamemode.Server.Commands
|
||||
|
||||
WeaponHash wHash = NAPI.Util.WeaponNameToModel(weapon);
|
||||
|
||||
if(wHash == default(WeaponHash))
|
||||
if (wHash == default(WeaponHash))
|
||||
{
|
||||
player.SendChatMessage("~r~[FEHLER]~s~ Diese Waffe existiert nicht.");
|
||||
return;
|
||||
@@ -199,5 +199,71 @@ namespace reallife_gamemode.Server.Commands
|
||||
|
||||
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