/ga universell für alle GangOwned Fraktionen
This commit is contained in:
@@ -48,35 +48,29 @@ namespace ReallifeGamemode.Server.Commands
|
||||
{
|
||||
User user = player.GetUser();
|
||||
Faction f = user?.Faction;
|
||||
if ((f == null || f.StateOwned) && !user.IsAdmin(AdminLevel.ADMIN))
|
||||
if ((f == null || !f.GangOwned) && !user.IsAdmin(AdminLevel.ADMIN))
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
}
|
||||
if (f?.Name == "Ballas" || f?.Name == "Grove" || user.IsAdmin(AdminLevel.ADMIN))
|
||||
|
||||
message = Regex.Replace(message, "(~[a-zA-Z]~)|(!{(.*)})", "");
|
||||
|
||||
string rank = string.Empty;
|
||||
|
||||
if (f?.GangOwned == true)
|
||||
{
|
||||
message = Regex.Replace(message, "(~[a-zA-Z]~)|(!{(.*)})", "");
|
||||
|
||||
string rank = string.Empty;
|
||||
|
||||
if (f?.Name == "Ballas" || f?.Name == "Grove")
|
||||
{
|
||||
rank = player.GetUser().GetFactionRank().RankName;
|
||||
}
|
||||
else
|
||||
{
|
||||
rank = "[ADMIN]";
|
||||
}
|
||||
|
||||
string broadcastMessage = "!{FF0000}** " + rank + " " + player.Name + ": " + message + " **";
|
||||
using (var context = new DatabaseContext())
|
||||
{
|
||||
ChatService.BroadcastFaction(broadcastMessage, context.Factions.ToList().FindAll(c => c.GangOwned), true);
|
||||
}
|
||||
rank = player.GetUser().GetFactionRank().RankName;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
rank = "[ADMIN]";
|
||||
}
|
||||
|
||||
string broadcastMessage = "!{FF0000}** " + rank + " " + player.Name + ": " + message + " **";
|
||||
using (var context = new DatabaseContext())
|
||||
{
|
||||
ChatService.BroadcastFaction(broadcastMessage, context.Factions.ToList().FindAll(c => c.GangOwned), true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -356,7 +350,7 @@ namespace ReallifeGamemode.Server.Commands
|
||||
public void CmdFactionMedicHealive(Player player, string receiver, int price = 10)
|
||||
{
|
||||
Player target = PlayerService.GetPlayerByNameOrId(receiver);
|
||||
if(target == null || !target.IsLoggedIn())
|
||||
if (target == null || !target.IsLoggedIn())
|
||||
{
|
||||
ChatService.PlayerNotFound(player);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user