Merge branch 'develop' of ssh://development.life-of-german.org:451/log-gtav/reallife-gamemode into develop
This commit is contained in:
@@ -32,8 +32,6 @@ export default function customNametags() {
|
|||||||
|
|
||||||
mp.nametags.enabled = false;
|
mp.nametags.enabled = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
mp.events.add('render', (nametags) => {
|
mp.events.add('render', (nametags) => {
|
||||||
const graphics = mp.game.graphics;
|
const graphics = mp.game.graphics;
|
||||||
const screenRes = graphics.getScreenResolution(0, 0);
|
const screenRes = graphics.getScreenResolution(0, 0);
|
||||||
@@ -53,6 +51,7 @@ export default function customNametags() {
|
|||||||
y -= scale * (0.005 * (screenRes.y / 1080));
|
y -= scale * (0.005 * (screenRes.y / 1080));
|
||||||
|
|
||||||
let colorId = game.players.at(player.remoteId).nametagColor;
|
let colorId = game.players.at(player.remoteId).nametagColor;
|
||||||
|
|
||||||
let color = colors.find(c => c.id === colorId).color;
|
let color = colors.find(c => c.id === colorId).color;
|
||||||
|
|
||||||
mp.game.graphics.drawText(player.name + " (" + player.remoteId + ")", [x, y],
|
mp.game.graphics.drawText(player.name + " (" + player.remoteId + ")", [x, y],
|
||||||
|
|||||||
@@ -72,7 +72,8 @@ class RagePlayer extends RageEntity implements IPlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get nametagColor(): number {
|
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)
|
if (!color)
|
||||||
return 0;
|
return 0;
|
||||||
return color;
|
return color;
|
||||||
|
|||||||
5562
ReallifeGamemode.Client/package-lock.json
generated
5562
ReallifeGamemode.Client/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -22,6 +22,5 @@
|
|||||||
"ProjectOpened": [
|
"ProjectOpened": [
|
||||||
"watch"
|
"watch"
|
||||||
]
|
]
|
||||||
},
|
}
|
||||||
"dependencies": {}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,18 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
{
|
{
|
||||||
message = Regex.Replace(message, "(~[a-zA-Z]~)|(!{(.*)})", "");
|
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())
|
using (var context = new DatabaseContext())
|
||||||
{
|
{
|
||||||
ChatService.BroadcastFaction(broadcastMessage, context.Factions.ToList().FindAll(c => c.GangOwned), true);
|
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]~)|(!{(.*)})", "");
|
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 =>
|
NAPI.Pools.GetAllPlayers().ForEach(p =>
|
||||||
{
|
{
|
||||||
User pUser = p.GetUser();
|
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);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -58,12 +58,9 @@ namespace ReallifeGamemode.Server.Services
|
|||||||
{
|
{
|
||||||
User user = c.GetUser();
|
User user = c.GetUser();
|
||||||
Faction f = user?.Faction;
|
Faction f = user?.Faction;
|
||||||
if (f != null)
|
if (f != null && factions.Find(fT => fT.Id == f.Id) != null)
|
||||||
{
|
{
|
||||||
if (factions.Find(fT => fT.Id == f.Id) != null)
|
ChatService.SendMessage(c, message);
|
||||||
{
|
|
||||||
ChatService.SendMessage(c, message);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (user.IsAdmin(AdminLevel.ADMIN) && toAdmins)
|
else if (user.IsAdmin(AdminLevel.ADMIN) && toAdmins)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user