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-04 23:08:43 +02:00
6 changed files with 5573 additions and 35 deletions

View File

@@ -32,8 +32,6 @@ export default function customNametags() {
mp.nametags.enabled = false;
mp.events.add('render', (nametags) => {
const graphics = mp.game.graphics;
const screenRes = graphics.getScreenResolution(0, 0);
@@ -53,6 +51,7 @@ export default function customNametags() {
y -= scale * (0.005 * (screenRes.y / 1080));
let colorId = game.players.at(player.remoteId).nametagColor;
let color = colors.find(c => c.id === colorId).color;
mp.game.graphics.drawText(player.name + " (" + player.remoteId + ")", [x, y],

View File

@@ -72,7 +72,8 @@ class RagePlayer extends RageEntity implements IPlayer {
}
get nametagColor(): number {
var color = this.player.getVariable("nametagColor");
var color = this.player.getVariable("nameTagColor");
game.ui.sendChatMessage(`player = ${this.player.name} - color = ${color}`);
if (!color)
return 0;
return color;

File diff suppressed because it is too large Load Diff

View File

@@ -22,6 +22,5 @@
"ProjectOpened": [
"watch"
]
},
"dependencies": {}
}
}

View File

@@ -55,7 +55,18 @@ namespace ReallifeGamemode.Server.Commands
{
message = Regex.Replace(message, "(~[a-zA-Z]~)|(!{(.*)})", "");
string broadcastMessage = "!{FF0000}** " + player.GetUser().GetFactionRank().RankName + " " + player.Name + ": " + message + " **";
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);
@@ -188,12 +199,25 @@ namespace ReallifeGamemode.Server.Commands
message = Regex.Replace(message, "(~[a-zA-Z]~)|(!{(.*)})", "");
string broadcastMsg = "~y~[" + player.GetUser().Faction.Name + "] " + player.Name + ": " + message;
string factionName = string.Empty;
if(user.FactionLeader)
{
factionName = player.GetUser().Faction.Name;
}
else
{
factionName = "ADMIN";
}
string broadcastMsg = "~y~[" + factionName + "] " + player.Name + ": " + message;
NAPI.Pools.GetAllPlayers().ForEach(p =>
{
User pUser = p.GetUser();
if (pUser?.FactionLeader ?? false || pUser.IsAdmin(AdminLevel.ADMIN)) ChatService.SendMessage(p, broadcastMsg);
if (pUser.FactionLeader || pUser.IsAdmin(AdminLevel.ADMIN))
{
ChatService.SendMessage(p, broadcastMsg);
}
});
}

View File

@@ -58,13 +58,10 @@ namespace ReallifeGamemode.Server.Services
{
User user = c.GetUser();
Faction f = user?.Faction;
if (f != null)
{
if (factions.Find(fT => fT.Id == f.Id) != null)
if (f != null && factions.Find(fT => fT.Id == f.Id) != null)
{
ChatService.SendMessage(c, message);
}
}
else if (user.IsAdmin(AdminLevel.ADMIN) && toAdmins)
{
ChatService.SendMessage(c, message);