setweaponrank von überall
This commit is contained in:
@@ -234,18 +234,19 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
[Command("setweaponrank", "~m~Benutzung: ~s~/setweaponrank [Waffen Name] [Rank]")]
|
[Command("setweaponrank", "~m~Benutzung: ~s~/setweaponrank [Waffen Name] [Rank]")]
|
||||||
public void CmdFactionWeaponRank(Player player, string weaponModel, int rank)
|
public void CmdFactionWeaponRank(Player player, string weaponModel, int rank)
|
||||||
{
|
{
|
||||||
if (player.GetUser()?.FactionId == null || player.GetUser().FactionLeader == false)
|
User user = player.GetUser();
|
||||||
|
if (user == null || user.FactionId == null || user.FactionLeader == false)
|
||||||
{
|
{
|
||||||
ChatService.NotAuthorized(player);
|
ChatService.NotAuthorized(player);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rank > 12 || rank < 1)
|
if (rank > 12 || rank < 1)
|
||||||
{
|
{
|
||||||
ChatService.ErrorMessage(player, "Gebe einen gültigen Rang ein");
|
ChatService.ErrorMessage(player, "Gebe einen gültigen Rang ein");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
User user = player.GetUser();
|
|
||||||
WeaponPoint nearestWeapon = PositionManager.WeaponPoints.Find(w => w.Position.DistanceTo(player.Position) <= 1.5 && w.FactionId == user.FactionId);
|
WeaponPoint nearestWeapon = PositionManager.WeaponPoints.Find(w => w.Position.DistanceTo(player.Position) <= 1.5 && w.FactionId == user.FactionId);
|
||||||
if (nearestWeapon == null)
|
if (nearestWeapon == null)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user