Continued faction system

This commit is contained in:
hydrant
2018-09-22 16:48:03 +02:00
parent bac110258d
commit 0034f29b18
6 changed files with 75 additions and 3 deletions

View File

@@ -0,0 +1,41 @@
using GTANetworkAPI;
using reallife_gamemode.Server.Entities;
using reallife_gamemode.Server.Extensions;
using reallife_gamemode.Server.Services;
using System;
using System.Collections.Generic;
using System.Text;
/**
* @overview Life of German Reallife - Faction Commands (Faction.cs)
* @author VegaZ, hydrant
* @copyright (c) 2008 - 2018 Life of German
*/
namespace reallife_gamemode.Server.Commands
{
class Faction : Script
{
[Command("f", "~m~Benutzung: ~s~/f [Nachricht]", GreedyArg = true)]
public void CmdFactionF(Client player, string message)
{
User u = player.GetUser();
if(u == null)
{
NAPI.Util.ConsoleOutput("u is null");
return;
}
Entities.Faction f = u.Faction;
if(f == null)
{
NAPI.Util.ConsoleOutput("f is null");
return;
}
string broadcastMessage = "** " + player.Name + ": " + message + " )) **";
ChatService.BroadcastFaction(broadcastMessage, player.GetFaction());
}
}
}