Merge branch 'develop' of ssh://development.life-of-german.org:451/log-gtav/reallife-gamemode into develop

This commit is contained in:
kookroach
2021-04-05 02:28:08 +02:00
13 changed files with 307 additions and 4 deletions

View File

@@ -97,8 +97,9 @@ namespace ReallifeGamemode.Server.Commands
[Command("d", "~m~Benutzung: ~s~/d [Nachricht]", GreedyArg = true)]
public void CmdFactionD(Player player, string message)
{
User u = player.GetUser();
Faction f = player.GetUser()?.Faction;
if (f == null || !f.StateOwned)
if ((f == null || !f.StateOwned) && !u.IsAdmin(AdminLevel.ADMIN))
{
ChatService.NotAuthorized(player);
return;
@@ -106,10 +107,21 @@ namespace ReallifeGamemode.Server.Commands
message = Regex.Replace(message, "(~[a-zA-Z]~)|(!{(.*)})", "");
string broadcastMessage = "!{CC3333}** " + player.GetUser().GetFactionRank().RankName + " " + player.Name + ": " + message + ", over **";
string factionName = string.Empty;
if(f.StateOwned)
{
factionName = player.GetUser().GetFactionRank().RankName;
}
else
{
factionName = "[ADMIN]";
}
string broadcastMessage = "!{CC3333}** " + factionName + " " + player.Name + ": " + message + ", over **";
using (var context = new DatabaseContext())
{
ChatService.BroadcastFaction(broadcastMessage, context.Factions.ToList().FindAll(c => c.StateOwned));
ChatService.BroadcastFaction(broadcastMessage, context.Factions.ToList().FindAll(c => c.StateOwned), true);
}
}

View File

@@ -305,7 +305,7 @@ namespace ReallifeGamemode.Server.Events
case 3:
//nameTagColor = new Color(173, 0, 118);
player.SetSharedData("nameTagColor", factionId);
player.SetSharedData("blipColor", 72);
player.SetSharedData("blipColor", 63);
player.SetAccessories(2, 2, 0);
break;
}

View File

@@ -131,6 +131,7 @@ namespace ReallifeGamemode.Server.Extensions
dbUser.Wanteds = newWanteds;
dbContext.SaveChanges();
}
user.Player.SetSharedData("nameTagColor", -1);
user.Player.SetSharedData("blipColor", 64);
ChatService.SendMessage(user.Player, "!{#FF614A}Du hast ein Verbrechen begangen: " + reason + "" + (cop != null ? " | Gemeldet von: " + cop.Name + "." : ""));
ChatService.SendMessage(user.Player, " !{#FFFF00}Fahnundgslevel:~s~ " + newWanteds);

View File

@@ -123,9 +123,15 @@ namespace ReallifeGamemode.Server.Job
public static void UpdateFare()
{
foreach (var player in GetPlayerInJob())
{
User u = player.GetUser();
if(u == null)
{
continue;
}
if (u.JobId != 1) return;
if (!player.HasData("hasPassager")) { player.SetData<bool>("hasPassager", false); continue; }
int playerId = player.GetUser().Id;