Files
reallife-gamemode/ReallifeGamemode.Server/Commands/GroupCommands.cs
2019-07-17 19:52:55 +02:00

32 lines
800 B
C#

using GTANetworkAPI;
using ReallifeGamemode.Server.Extensions;
using ReallifeGamemode.Server.Services;
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
namespace ReallifeGamemode.Server.Commands
{
class GroupCommands : Script
{
#region Chat Commands
[Command("g", "~m~Benutzung: ~s~/g [Nachricht]", GreedyArg = true)]
public void CmdGroupG(Client player, string message)
{
Entities.Group group = player.GetUser().Group;
if (group == null)
{
ChatService.NotAuthorized(player);
return;
}
message = Regex.Replace(message, "(~[a-zA-Z]~)|(!{(.*)})", "");
message = $"{player.Name}: {message}";
ChatService.BroadcastGroup(message, group);
}
#endregion
}
}