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
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ namespace reallife_gamemode.Server.Commands
|
|||||||
player.SendChatMessage("~r~[FEHLER]~s~ Du sitzt momentan schon in einem Fahrzeug.");
|
player.SendChatMessage("~r~[FEHLER]~s~ Du sitzt momentan schon in einem Fahrzeug.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vehicle v = NAPI.Vehicle.CreateVehicle(hash, player.Position, player.Rotation.Z, color1, color2);
|
Vehicle v = NAPI.Vehicle.CreateVehicle(hash, player.Position, player.Rotation.Z, color1, color2);
|
||||||
|
|
||||||
player.SetIntoVehicle(v.Handle, -1);
|
player.SetIntoVehicle(v.Handle, -1);
|
||||||
@@ -99,7 +99,7 @@ namespace reallife_gamemode.Server.Commands
|
|||||||
|
|
||||||
Client target = ClientService.GetClientByName(name);
|
Client target = ClientService.GetClientByName(name);
|
||||||
|
|
||||||
if(target == null)
|
if (target == null)
|
||||||
{
|
{
|
||||||
ChatService.PlayerNotFound(player);
|
ChatService.PlayerNotFound(player);
|
||||||
return;
|
return;
|
||||||
@@ -150,13 +150,13 @@ namespace reallife_gamemode.Server.Commands
|
|||||||
}
|
}
|
||||||
|
|
||||||
option = option.ToLower();
|
option = option.ToLower();
|
||||||
|
|
||||||
if(option == "load")
|
if (option == "load")
|
||||||
{
|
{
|
||||||
NAPI.World.RequestIpl(name);
|
NAPI.World.RequestIpl(name);
|
||||||
player.SendChatMessage("~g~Das IPL ~s~" + name + " ~g~wurde erfolgreich geladen");
|
player.SendChatMessage("~g~Das IPL ~s~" + name + " ~g~wurde erfolgreich geladen");
|
||||||
}
|
}
|
||||||
else if(option == "remove")
|
else if (option == "remove")
|
||||||
{
|
{
|
||||||
NAPI.World.RemoveIpl(name);
|
NAPI.World.RemoveIpl(name);
|
||||||
player.SendChatMessage("~g~Das IPL ~s~" + name + " ~g~wurde erfolgreich entladen");
|
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);
|
WeaponHash wHash = NAPI.Util.WeaponNameToModel(weapon);
|
||||||
|
|
||||||
if(wHash == default(WeaponHash))
|
if (wHash == default(WeaponHash))
|
||||||
{
|
{
|
||||||
player.SendChatMessage("~r~[FEHLER]~s~ Diese Waffe existiert nicht.");
|
player.SendChatMessage("~r~[FEHLER]~s~ Diese Waffe existiert nicht.");
|
||||||
return;
|
return;
|
||||||
@@ -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