From 7d4f4bd54f1052a4ef04e12b03a8ba16fb362e1d Mon Sep 17 00:00:00 2001 From: kookroach <62265045+kookroach@users.noreply.github.com> Date: Sun, 4 Apr 2021 01:51:58 +0200 Subject: [PATCH 01/14] Changes on Money you get --- ReallifeGamemode.Client/index.ts | 2 ++ ReallifeGamemode.Server/Finance/Economy.cs | 1 - ReallifeGamemode.Server/Job/RefuseCollectorJob.cs | 12 ++++++------ ReallifeGamemode.Server/Util/CheckPointHandle.cs | 10 +++++----- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/ReallifeGamemode.Client/index.ts b/ReallifeGamemode.Client/index.ts index 848bcd2f..3dfc7746 100644 --- a/ReallifeGamemode.Client/index.ts +++ b/ReallifeGamemode.Client/index.ts @@ -224,8 +224,10 @@ refuseCollector(); import PedCreator from './Ped/PedCreator'; PedCreator(); +/* import attachmentManager from './util/attachmentMngr'; attachmentManager(game); +*/ import relativeVector from './util/relativevector'; relativeVector(); diff --git a/ReallifeGamemode.Server/Finance/Economy.cs b/ReallifeGamemode.Server/Finance/Economy.cs index 5db81d0e..4ab8214d 100644 --- a/ReallifeGamemode.Server/Finance/Economy.cs +++ b/ReallifeGamemode.Server/Finance/Economy.cs @@ -9,7 +9,6 @@ using System.Collections.Generic; using System.Linq; using GTANetworkAPI; using Microsoft.EntityFrameworkCore; -using Newtonsoft.Json; using ReallifeGamemode.Database.Entities; using ReallifeGamemode.Database.Models; using ReallifeGamemode.Server.Extensions; diff --git a/ReallifeGamemode.Server/Job/RefuseCollectorJob.cs b/ReallifeGamemode.Server/Job/RefuseCollectorJob.cs index 80d0e5fa..7a2aab4a 100644 --- a/ReallifeGamemode.Server/Job/RefuseCollectorJob.cs +++ b/ReallifeGamemode.Server/Job/RefuseCollectorJob.cs @@ -296,13 +296,13 @@ namespace ReallifeGamemode.Server.Job if (target != null) { - user1.Wage += 10; - user2.Wage += 10; + user1.Wage += 25; + user2.Wage += 25; } else { - user1.Wage += 20; + user1.Wage += 50; } dbContext.SaveChanges(); } @@ -331,12 +331,12 @@ namespace ReallifeGamemode.Server.Job if (target != null) { - user1.Wage += 100; - user2.Wage += 100; + user1.Wage += 250; + user2.Wage += 250; } else { - user1.Wage += 200; + user1.Wage += 500; } user1.trashcount -= user1.trashcount; diff --git a/ReallifeGamemode.Server/Util/CheckPointHandle.cs b/ReallifeGamemode.Server/Util/CheckPointHandle.cs index 1826cb92..b4268af4 100644 --- a/ReallifeGamemode.Server/Util/CheckPointHandle.cs +++ b/ReallifeGamemode.Server/Util/CheckPointHandle.cs @@ -9,11 +9,11 @@ namespace ReallifeGamemode.Server.Util { public class CheckPointHandle : Script { - public int BusSkill1RouteVerdienst = 500; - public int BusSkill2RouteVerdienst = 650; - public int BusSkill3RouteVerdienst = 800; - public int PilotSkill1RouteVerdienst = 550; - public int PilotSkill2RouteVerdienst = 750; + public int BusSkill1RouteVerdienst = 1000; + public int BusSkill2RouteVerdienst = 1300; + public int BusSkill3RouteVerdienst = 1600; + public int PilotSkill1RouteVerdienst = 1100; + public int PilotSkill2RouteVerdienst = 1500; public static List listHandle = new List(); public static void DeleteCheckpoints(Player player) From 5e078b727603fcc7b133bb0e3db5df1441b22896 Mon Sep 17 00:00:00 2001 From: kookroach <62265045+kookroach@users.noreply.github.com> Date: Sun, 4 Apr 2021 02:42:31 +0200 Subject: [PATCH 02/14] Fix Fractionrank for civil --- ReallifeGamemode.Server/Bank/bank.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ReallifeGamemode.Server/Bank/bank.cs b/ReallifeGamemode.Server/Bank/bank.cs index 31cefee7..47d9aca4 100644 --- a/ReallifeGamemode.Server/Bank/bank.cs +++ b/ReallifeGamemode.Server/Bank/bank.cs @@ -57,8 +57,8 @@ namespace ReallifeGamemode.Server.Bank } private static void EntityEnterFactionBankColShape(ColShape colShape, Player client) - { - if (client.IsInVehicle || !client.IsLoggedIn()) return; + { + if (client.IsInVehicle || !client.IsLoggedIn() || client.GetUser().FactionId is null) return; if (client.GetUser().FactionLeader == true) { From b7f9c97dc49b3540a5b8da14072ae8fcf7223d49 Mon Sep 17 00:00:00 2001 From: VegaZ Date: Sun, 4 Apr 2021 02:45:25 +0200 Subject: [PATCH 03/14] Nametagcolors --- ReallifeGamemode.Client/Gui/nametags.ts | 10 ++++++++-- ReallifeGamemode.Server/Events/Key.cs | 10 +++++++--- ReallifeGamemode.Server/Events/Login.cs | 3 +++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/ReallifeGamemode.Client/Gui/nametags.ts b/ReallifeGamemode.Client/Gui/nametags.ts index af6351aa..ace0c4b1 100644 --- a/ReallifeGamemode.Client/Gui/nametags.ts +++ b/ReallifeGamemode.Client/Gui/nametags.ts @@ -4,11 +4,18 @@ const height = 0.0065; const border = 0.001; const color = [73, 137, 0, 255]; var faction; +var playerColors = []; export default function customNametags() { mp.nametags.enabled = false; + mp.events.addDataHandler("nameTagColor", (entity, value) => { + if (entity.type === "player") { + entity.setVariable('nametagColor', value) + } + }); + mp.events.add('render', (nametags) => { const graphics = mp.game.graphics; const screenRes = graphics.getScreenResolution(0, 0); @@ -26,11 +33,10 @@ export default function customNametags() { var armour = player.getArmour() / 100; y -= scale * (0.005 * (screenRes.y / 1080)); - mp.game.graphics.drawText(player.name + " (" + player.remoteId + ")", [x, y], { font: 4, - color: [255, 255, 255, 255], //Grove //Ballas 171 0 207 //PD 0 95 190 //FIB 0 0 170 LSED 147 0 0 NR 0 166 133 Trucker 255 162 Support 0 255 255 Zivilist 255 255 255 + color: player.data.nametagColor, //Grove //Ballas 171 0 207 //PD 0 95 190 //FIB 0 0 170 LSED 147 0 0 NR 0 166 133 Trucker 255 162 Support 0 255 255 Zivilist 255 255 255 scale: [0.4, 0.4], outline: true, centre: false diff --git a/ReallifeGamemode.Server/Events/Key.cs b/ReallifeGamemode.Server/Events/Key.cs index 474d6d44..fe990230 100644 --- a/ReallifeGamemode.Server/Events/Key.cs +++ b/ReallifeGamemode.Server/Events/Key.cs @@ -278,19 +278,22 @@ namespace ReallifeGamemode.Server.Events { //LSPD case 1: - nameTagColor = new Color(28, 134, 238); + //nameTagColor = new Color(28, 134, 238); + player.SetSharedData("nameTagColor", new Color[28, 134, 238, 255]); player.SetSharedData("blipColor", 38); break; //Medic case 2: - nameTagColor = new Color(255, 0, 0); + //nameTagColor = new Color(255, 0, 0); + player.SetSharedData("nameTagColor", new Color[255, 0, 0, 255]); player.SetSharedData("blipColor", 79); break; //FBI case 3: - nameTagColor = new Color(173, 0, 118); + //nameTagColor = new Color(173, 0, 118); + player.SetSharedData("nameTagColor", new Color[173, 0, 118, 255]); player.SetSharedData("blipColor", 72); player.SetAccessories(2, 2, 0); break; @@ -326,6 +329,7 @@ namespace ReallifeGamemode.Server.Events player.TriggerEvent("toggleDutyMode", false); Medic.UpdateDutyMedics(-1); player.SetSharedData("blipColor", 0); + player.SetSharedData("nameTagColor", new Color[255, 255, 255, 255]); UpdateCharacterCloth.LoadCharacterDefaults(player); } } diff --git a/ReallifeGamemode.Server/Events/Login.cs b/ReallifeGamemode.Server/Events/Login.cs index 9db87c76..2f6eb2fb 100644 --- a/ReallifeGamemode.Server/Events/Login.cs +++ b/ReallifeGamemode.Server/Events/Login.cs @@ -108,10 +108,12 @@ namespace ReallifeGamemode.Server.Events case 8: player.SetSharedData("blipColor", 83); + player.SetSharedData("nameTagColor", new Color[171, 0, 207, 255]); break; case 7: player.SetSharedData("blipColor", 52); + player.SetSharedData("nameTagColor", new Color[0, 54, 0, 255]); break; case 4: @@ -119,6 +121,7 @@ namespace ReallifeGamemode.Server.Events break; case 9: player.SetSharedData("blipColor", 25); + player.SetSharedData("nameTagColor", new Color[0, 166, 133, 255]); break; } From b88cbfecbfba609022c9f00ad762d2733fd47c05 Mon Sep 17 00:00:00 2001 From: kookroach <62265045+kookroach@users.noreply.github.com> Date: Sun, 4 Apr 2021 02:49:09 +0200 Subject: [PATCH 04/14] Fix Skill for Pilot --- ReallifeGamemode.Server/Util/CheckPointHandle.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ReallifeGamemode.Server/Util/CheckPointHandle.cs b/ReallifeGamemode.Server/Util/CheckPointHandle.cs index b4268af4..1d8aa46f 100644 --- a/ReallifeGamemode.Server/Util/CheckPointHandle.cs +++ b/ReallifeGamemode.Server/Util/CheckPointHandle.cs @@ -177,24 +177,24 @@ namespace ReallifeGamemode.Server.Util { if (user.GetData("Route") == "Skill1Route1" || user.GetData("Route") == "Skill1Route2" || user.GetData("Route") == "Skill1Route3") { - BusDriverJob.payWage(user, PilotSkill1RouteVerdienst / temp.list.Count()); - BusDriverJob.payWage(user, PilotSkill1RouteVerdienst / temp.list.Count()); + PilotJob.payWage(user, PilotSkill1RouteVerdienst / temp.list.Count()); + PilotJob.payWage(user, PilotSkill1RouteVerdienst / temp.list.Count()); } if (user.GetData("Route") == "Skill2Route1" || user.GetData("Route") == "Skill2Route2" || user.GetData("Route") == "Skill2Route3") { - BusDriverJob.payWage(user, PilotSkill2RouteVerdienst / temp.list.Count()); - BusDriverJob.payWage(user, PilotSkill2RouteVerdienst / temp.list.Count()); + PilotJob.payWage(user, PilotSkill2RouteVerdienst / temp.list.Count()); + PilotJob.payWage(user, PilotSkill2RouteVerdienst / temp.list.Count()); } } if (temp.checkPointsDone > 2) { if (user.GetData("Route") == "Skill1Route1" || user.GetData("Route") == "Skill1Route2" || user.GetData("Route") == "Skill1Route3") { - BusDriverJob.payWage(user, PilotSkill1RouteVerdienst / temp.list.Count()); + PilotJob.payWage(user, PilotSkill1RouteVerdienst / temp.list.Count()); } if (user.GetData("Route") == "Skill2Route1" || user.GetData("Route") == "Skill2Route2" || user.GetData("Route") == "Skill2Route3") { - BusDriverJob.payWage(user, PilotSkill2RouteVerdienst / temp.list.Count()); + PilotJob.payWage(user, PilotSkill2RouteVerdienst / temp.list.Count()); } } //PilotJob.payWage(user, 100); From 47eecc1822f38fd8e05cdf5b200c181a2c6487b6 Mon Sep 17 00:00:00 2001 From: VegaZ Date: Sun, 4 Apr 2021 03:00:01 +0200 Subject: [PATCH 05/14] Fix Nametagcolor --- ReallifeGamemode.Client/Gui/nametags.ts | 4 ++-- ReallifeGamemode.Server/Events/Key.cs | 6 +++--- ReallifeGamemode.Server/Events/Login.cs | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ReallifeGamemode.Client/Gui/nametags.ts b/ReallifeGamemode.Client/Gui/nametags.ts index ace0c4b1..17eebe0a 100644 --- a/ReallifeGamemode.Client/Gui/nametags.ts +++ b/ReallifeGamemode.Client/Gui/nametags.ts @@ -12,7 +12,7 @@ export default function customNametags() { mp.events.addDataHandler("nameTagColor", (entity, value) => { if (entity.type === "player") { - entity.setVariable('nametagColor', value) + entity.setVariable('nametagColor',) } }); @@ -36,7 +36,7 @@ export default function customNametags() { mp.game.graphics.drawText(player.name + " (" + player.remoteId + ")", [x, y], { font: 4, - color: player.data.nametagColor, //Grove //Ballas 171 0 207 //PD 0 95 190 //FIB 0 0 170 LSED 147 0 0 NR 0 166 133 Trucker 255 162 Support 0 255 255 Zivilist 255 255 255 + color: [player.data.nametagColor[0], player.data.nametagColor[1], player.data.nametagColor[2], 200], //Grove //Ballas 171 0 207 //PD 0 95 190 //FIB 0 0 170 LSED 147 0 0 NR 0 166 133 Trucker 255 162 Support 0 255 255 Zivilist 255 255 255 scale: [0.4, 0.4], outline: true, centre: false diff --git a/ReallifeGamemode.Server/Events/Key.cs b/ReallifeGamemode.Server/Events/Key.cs index fe990230..d749ae7d 100644 --- a/ReallifeGamemode.Server/Events/Key.cs +++ b/ReallifeGamemode.Server/Events/Key.cs @@ -279,21 +279,21 @@ namespace ReallifeGamemode.Server.Events //LSPD case 1: //nameTagColor = new Color(28, 134, 238); - player.SetSharedData("nameTagColor", new Color[28, 134, 238, 255]); + player.SetSharedData("nameTagColor", new int[] { 28, 134, 238}); player.SetSharedData("blipColor", 38); break; //Medic case 2: //nameTagColor = new Color(255, 0, 0); - player.SetSharedData("nameTagColor", new Color[255, 0, 0, 255]); + player.SetSharedData("nameTagColor", new int[] { 255, 0, 0}); player.SetSharedData("blipColor", 79); break; //FBI case 3: //nameTagColor = new Color(173, 0, 118); - player.SetSharedData("nameTagColor", new Color[173, 0, 118, 255]); + player.SetSharedData("nameTagColor", new int[] { 173, 0, 118}); player.SetSharedData("blipColor", 72); player.SetAccessories(2, 2, 0); break; diff --git a/ReallifeGamemode.Server/Events/Login.cs b/ReallifeGamemode.Server/Events/Login.cs index 2f6eb2fb..ea08311e 100644 --- a/ReallifeGamemode.Server/Events/Login.cs +++ b/ReallifeGamemode.Server/Events/Login.cs @@ -108,12 +108,12 @@ namespace ReallifeGamemode.Server.Events case 8: player.SetSharedData("blipColor", 83); - player.SetSharedData("nameTagColor", new Color[171, 0, 207, 255]); + player.SetSharedData("nameTagColor", new int[]{171, 0, 207}); break; case 7: player.SetSharedData("blipColor", 52); - player.SetSharedData("nameTagColor", new Color[0, 54, 0, 255]); + player.SetSharedData("nameTagColor", new int[] { 0, 54, 0}); break; case 4: @@ -121,7 +121,7 @@ namespace ReallifeGamemode.Server.Events break; case 9: player.SetSharedData("blipColor", 25); - player.SetSharedData("nameTagColor", new Color[0, 166, 133, 255]); + player.SetSharedData("nameTagColor", new int[] { 0, 166, 133}); break; } From a340ae850786976a8d4bd7d9ba20716f4c2daf7f Mon Sep 17 00:00:00 2001 From: VegaZ Date: Sun, 4 Apr 2021 03:04:40 +0200 Subject: [PATCH 06/14] Fix Nametagcolor --- ReallifeGamemode.Client/Gui/nametags.ts | 2 ++ ReallifeGamemode.Server/Events/Login.cs | 1 + 2 files changed, 3 insertions(+) diff --git a/ReallifeGamemode.Client/Gui/nametags.ts b/ReallifeGamemode.Client/Gui/nametags.ts index 17eebe0a..4faefa77 100644 --- a/ReallifeGamemode.Client/Gui/nametags.ts +++ b/ReallifeGamemode.Client/Gui/nametags.ts @@ -20,6 +20,8 @@ export default function customNametags() { const graphics = mp.game.graphics; const screenRes = graphics.getScreenResolution(0, 0); + + nametags.forEach(nametag => { let [player, x, y, distance] = nametag; diff --git a/ReallifeGamemode.Server/Events/Login.cs b/ReallifeGamemode.Server/Events/Login.cs index ea08311e..26dd66d1 100644 --- a/ReallifeGamemode.Server/Events/Login.cs +++ b/ReallifeGamemode.Server/Events/Login.cs @@ -104,6 +104,7 @@ namespace ReallifeGamemode.Server.Events { case null: player.SetSharedData("blipColor", 0); + player.SetSharedData("nameTagColor", new int[] { 255, 255, 255 }); break; case 8: From 7d2faa8c744e2528268bdef812a353c207cf0b22 Mon Sep 17 00:00:00 2001 From: VegaZ Date: Sun, 4 Apr 2021 03:06:04 +0200 Subject: [PATCH 07/14] Fix Nametagcolor --- ReallifeGamemode.Server/Events/Login.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ReallifeGamemode.Server/Events/Login.cs b/ReallifeGamemode.Server/Events/Login.cs index 26dd66d1..54c7e342 100644 --- a/ReallifeGamemode.Server/Events/Login.cs +++ b/ReallifeGamemode.Server/Events/Login.cs @@ -107,6 +107,11 @@ namespace ReallifeGamemode.Server.Events player.SetSharedData("nameTagColor", new int[] { 255, 255, 255 }); break; + case 0: + player.SetSharedData("blipColor", 0); + player.SetSharedData("nameTagColor", new int[] { 255, 255, 255 }); + break; + case 8: player.SetSharedData("blipColor", 83); player.SetSharedData("nameTagColor", new int[]{171, 0, 207}); From 0a518ebf5b6eb17646b67fda8b3e2fda25b56358 Mon Sep 17 00:00:00 2001 From: VegaZ Date: Sun, 4 Apr 2021 03:12:28 +0200 Subject: [PATCH 08/14] Fix Nametags, ich bin dUMM --- ReallifeGamemode.Client/Gui/nametags.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ReallifeGamemode.Client/Gui/nametags.ts b/ReallifeGamemode.Client/Gui/nametags.ts index 4faefa77..718eb7d4 100644 --- a/ReallifeGamemode.Client/Gui/nametags.ts +++ b/ReallifeGamemode.Client/Gui/nametags.ts @@ -12,7 +12,8 @@ export default function customNametags() { mp.events.addDataHandler("nameTagColor", (entity, value) => { if (entity.type === "player") { - entity.setVariable('nametagColor',) + entity.setVariable('nametagColor',value) + mp.gui.chat.push(value); } }); From 8ed6df5182561ad8419e5d69f1cbb32b073692b7 Mon Sep 17 00:00:00 2001 From: VegaZ Date: Sun, 4 Apr 2021 03:21:08 +0200 Subject: [PATCH 09/14] Fix Nametags 4 --- ReallifeGamemode.Client/Gui/nametags.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ReallifeGamemode.Client/Gui/nametags.ts b/ReallifeGamemode.Client/Gui/nametags.ts index 718eb7d4..5094daf5 100644 --- a/ReallifeGamemode.Client/Gui/nametags.ts +++ b/ReallifeGamemode.Client/Gui/nametags.ts @@ -39,7 +39,8 @@ export default function customNametags() { mp.game.graphics.drawText(player.name + " (" + player.remoteId + ")", [x, y], { font: 4, - color: [player.data.nametagColor[0], player.data.nametagColor[1], player.data.nametagColor[2], 200], //Grove //Ballas 171 0 207 //PD 0 95 190 //FIB 0 0 170 LSED 147 0 0 NR 0 166 133 Trucker 255 162 Support 0 255 255 Zivilist 255 255 255 + //color: [player.data.nametagColor[0], player.data.nametagColor[1], player.data.nametagColor[2], 200], //Grove //Ballas 171 0 207 //PD 0 95 190 //FIB 0 0 170 LSED 147 0 0 NR 0 166 133 Trucker 255 162 Support 0 255 255 Zivilist 255 255 255 + color: [255, 255, 255, 255], scale: [0.4, 0.4], outline: true, centre: false From e14e23947e4c7cf0dd3cbbf4179d6f5f76c091ea Mon Sep 17 00:00:00 2001 From: VegaZ Date: Sun, 4 Apr 2021 03:28:38 +0200 Subject: [PATCH 10/14] Fix NT 5 --- ReallifeGamemode.Client/Gui/nametags.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReallifeGamemode.Client/Gui/nametags.ts b/ReallifeGamemode.Client/Gui/nametags.ts index 5094daf5..d23f9e12 100644 --- a/ReallifeGamemode.Client/Gui/nametags.ts +++ b/ReallifeGamemode.Client/Gui/nametags.ts @@ -12,7 +12,7 @@ export default function customNametags() { mp.events.addDataHandler("nameTagColor", (entity, value) => { if (entity.type === "player") { - entity.setVariable('nametagColor',value) + //entity.setVariable('nametagColor',value) mp.gui.chat.push(value); } }); From 7d8fbfe7d9d27fb7b95039e49ad0bdcbf543aa3d Mon Sep 17 00:00:00 2001 From: VegaZ Date: Sun, 4 Apr 2021 03:42:00 +0200 Subject: [PATCH 11/14] Fix NT 6 --- ReallifeGamemode.Client/Gui/nametags.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ReallifeGamemode.Client/Gui/nametags.ts b/ReallifeGamemode.Client/Gui/nametags.ts index d23f9e12..90c36098 100644 --- a/ReallifeGamemode.Client/Gui/nametags.ts +++ b/ReallifeGamemode.Client/Gui/nametags.ts @@ -12,8 +12,9 @@ export default function customNametags() { mp.events.addDataHandler("nameTagColor", (entity, value) => { if (entity.type === "player") { + var color = JSON.parse(value); //entity.setVariable('nametagColor',value) - mp.gui.chat.push(value); + mp.gui.chat.push(color); } }); From 758cbbabb38e6860a465b8f4e3f829187d3ae00a Mon Sep 17 00:00:00 2001 From: VegaZ Date: Sun, 4 Apr 2021 03:51:03 +0200 Subject: [PATCH 12/14] Fix NT 7 --- ReallifeGamemode.Client/Gui/nametags.ts | 13 +++++++++---- ReallifeGamemode.Server/Events/Key.cs | 4 +++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ReallifeGamemode.Client/Gui/nametags.ts b/ReallifeGamemode.Client/Gui/nametags.ts index 90c36098..9cf0618d 100644 --- a/ReallifeGamemode.Client/Gui/nametags.ts +++ b/ReallifeGamemode.Client/Gui/nametags.ts @@ -13,11 +13,16 @@ export default function customNametags() { mp.events.addDataHandler("nameTagColor", (entity, value) => { if (entity.type === "player") { var color = JSON.parse(value); - //entity.setVariable('nametagColor',value) - mp.gui.chat.push(color); + entity.setVariable('nametagColor',color) + //mp.gui.chat.push(color); } }); + mp.events.add('setNameTag', (value) => { + var color = JSON.parse(value); + mp.gui.chat.push(color); + }); + mp.events.add('render', (nametags) => { const graphics = mp.game.graphics; const screenRes = graphics.getScreenResolution(0, 0); @@ -40,8 +45,8 @@ export default function customNametags() { mp.game.graphics.drawText(player.name + " (" + player.remoteId + ")", [x, y], { font: 4, - //color: [player.data.nametagColor[0], player.data.nametagColor[1], player.data.nametagColor[2], 200], //Grove //Ballas 171 0 207 //PD 0 95 190 //FIB 0 0 170 LSED 147 0 0 NR 0 166 133 Trucker 255 162 Support 0 255 255 Zivilist 255 255 255 - color: [255, 255, 255, 255], + color: [player.data.nametagColor[0], player.data.nametagColor[1], player.data.nametagColor[2], 200], //Grove //Ballas 171 0 207 //PD 0 95 190 //FIB 0 0 170 LSED 147 0 0 NR 0 166 133 Trucker 255 162 Support 0 255 255 Zivilist 255 255 255 + //color: [255, 255, 255, 255], scale: [0.4, 0.4], outline: true, centre: false diff --git a/ReallifeGamemode.Server/Events/Key.cs b/ReallifeGamemode.Server/Events/Key.cs index d749ae7d..8e978c02 100644 --- a/ReallifeGamemode.Server/Events/Key.cs +++ b/ReallifeGamemode.Server/Events/Key.cs @@ -279,13 +279,15 @@ namespace ReallifeGamemode.Server.Events //LSPD case 1: //nameTagColor = new Color(28, 134, 238); - player.SetSharedData("nameTagColor", new int[] { 28, 134, 238}); + player.TriggerEvent("setNameTag", JsonConvert.SerializeObject(new int[] { 28, 134, 238 })) + player.SetSharedData("nameTagColor", JsonConvert.SerializeObject(new int[] { 28, 134, 238})); player.SetSharedData("blipColor", 38); break; //Medic case 2: //nameTagColor = new Color(255, 0, 0); + player.TriggerEvent("setNameTag", JsonConvert.SerializeObject(new int[] { 255, 0, 0 })); player.SetSharedData("nameTagColor", new int[] { 255, 0, 0}); player.SetSharedData("blipColor", 79); break; From e36a6d6e2d68388479136c35308eea47130f9774 Mon Sep 17 00:00:00 2001 From: VegaZ Date: Sun, 4 Apr 2021 04:00:39 +0200 Subject: [PATCH 13/14] Nametagneuerungen auskommentiert --- ReallifeGamemode.Client/Gui/nametags.ts | 10 ++++------ ReallifeGamemode.Server/Events/Key.cs | 10 +++++----- ReallifeGamemode.Server/Events/Login.cs | 10 +++++----- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/ReallifeGamemode.Client/Gui/nametags.ts b/ReallifeGamemode.Client/Gui/nametags.ts index 9cf0618d..df6fc96d 100644 --- a/ReallifeGamemode.Client/Gui/nametags.ts +++ b/ReallifeGamemode.Client/Gui/nametags.ts @@ -9,7 +9,7 @@ var playerColors = []; export default function customNametags() { mp.nametags.enabled = false; - + /* mp.events.addDataHandler("nameTagColor", (entity, value) => { if (entity.type === "player") { var color = JSON.parse(value); @@ -21,14 +21,12 @@ export default function customNametags() { mp.events.add('setNameTag', (value) => { var color = JSON.parse(value); mp.gui.chat.push(color); - }); + });*/ mp.events.add('render', (nametags) => { const graphics = mp.game.graphics; const screenRes = graphics.getScreenResolution(0, 0); - - nametags.forEach(nametag => { let [player, x, y, distance] = nametag; @@ -45,8 +43,8 @@ export default function customNametags() { mp.game.graphics.drawText(player.name + " (" + player.remoteId + ")", [x, y], { font: 4, - color: [player.data.nametagColor[0], player.data.nametagColor[1], player.data.nametagColor[2], 200], //Grove //Ballas 171 0 207 //PD 0 95 190 //FIB 0 0 170 LSED 147 0 0 NR 0 166 133 Trucker 255 162 Support 0 255 255 Zivilist 255 255 255 - //color: [255, 255, 255, 255], + //color: [player.data.nametagColor[0], player.data.nametagColor[1], player.data.nametagColor[2], 200], //Grove //Ballas 171 0 207 //PD 0 95 190 //FIB 0 0 170 LSED 147 0 0 NR 0 166 133 Trucker 255 162 Support 0 255 255 Zivilist 255 255 255 + color: [255, 255, 255, 255], scale: [0.4, 0.4], outline: true, centre: false diff --git a/ReallifeGamemode.Server/Events/Key.cs b/ReallifeGamemode.Server/Events/Key.cs index 8e978c02..9ae0aaaa 100644 --- a/ReallifeGamemode.Server/Events/Key.cs +++ b/ReallifeGamemode.Server/Events/Key.cs @@ -279,23 +279,23 @@ namespace ReallifeGamemode.Server.Events //LSPD case 1: //nameTagColor = new Color(28, 134, 238); - player.TriggerEvent("setNameTag", JsonConvert.SerializeObject(new int[] { 28, 134, 238 })) - player.SetSharedData("nameTagColor", JsonConvert.SerializeObject(new int[] { 28, 134, 238})); + //player.TriggerEvent("setNameTag", JsonConvert.SerializeObject(new int[] { 28, 134, 238 })); + //player.SetSharedData("nameTagColor", JsonConvert.SerializeObject(new int[] { 28, 134, 238})); player.SetSharedData("blipColor", 38); break; //Medic case 2: //nameTagColor = new Color(255, 0, 0); - player.TriggerEvent("setNameTag", JsonConvert.SerializeObject(new int[] { 255, 0, 0 })); - player.SetSharedData("nameTagColor", new int[] { 255, 0, 0}); + //player.TriggerEvent("setNameTag", JsonConvert.SerializeObject(new int[] { 255, 0, 0 })); + //player.SetSharedData("nameTagColor", new int[] { 255, 0, 0}); player.SetSharedData("blipColor", 79); break; //FBI case 3: //nameTagColor = new Color(173, 0, 118); - player.SetSharedData("nameTagColor", new int[] { 173, 0, 118}); + //player.SetSharedData("nameTagColor", new int[] { 173, 0, 118}); player.SetSharedData("blipColor", 72); player.SetAccessories(2, 2, 0); break; diff --git a/ReallifeGamemode.Server/Events/Login.cs b/ReallifeGamemode.Server/Events/Login.cs index 54c7e342..4667db80 100644 --- a/ReallifeGamemode.Server/Events/Login.cs +++ b/ReallifeGamemode.Server/Events/Login.cs @@ -104,22 +104,22 @@ namespace ReallifeGamemode.Server.Events { case null: player.SetSharedData("blipColor", 0); - player.SetSharedData("nameTagColor", new int[] { 255, 255, 255 }); + //player.SetSharedData("nameTagColor", new int[] { 255, 255, 255 }); break; case 0: player.SetSharedData("blipColor", 0); - player.SetSharedData("nameTagColor", new int[] { 255, 255, 255 }); + //player.SetSharedData("nameTagColor", new int[] { 255, 255, 255 }); break; case 8: player.SetSharedData("blipColor", 83); - player.SetSharedData("nameTagColor", new int[]{171, 0, 207}); + //player.SetSharedData("nameTagColor", new int[]{171, 0, 207}); break; case 7: player.SetSharedData("blipColor", 52); - player.SetSharedData("nameTagColor", new int[] { 0, 54, 0}); + //player.SetSharedData("nameTagColor", new int[] { 0, 54, 0}); break; case 4: @@ -127,7 +127,7 @@ namespace ReallifeGamemode.Server.Events break; case 9: player.SetSharedData("blipColor", 25); - player.SetSharedData("nameTagColor", new int[] { 0, 166, 133}); + //player.SetSharedData("nameTagColor", new int[] { 0, 166, 133}); break; } From db681c170e5ac4fa8cc98aa4dafcd3b1a577b335 Mon Sep 17 00:00:00 2001 From: VegaZ Date: Sun, 4 Apr 2021 04:04:04 +0200 Subject: [PATCH 14/14] Nametagneuerungen auskommentiert 2 --- ReallifeGamemode.Server/Events/Key.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReallifeGamemode.Server/Events/Key.cs b/ReallifeGamemode.Server/Events/Key.cs index 9ae0aaaa..47008c2e 100644 --- a/ReallifeGamemode.Server/Events/Key.cs +++ b/ReallifeGamemode.Server/Events/Key.cs @@ -331,7 +331,7 @@ namespace ReallifeGamemode.Server.Events player.TriggerEvent("toggleDutyMode", false); Medic.UpdateDutyMedics(-1); player.SetSharedData("blipColor", 0); - player.SetSharedData("nameTagColor", new Color[255, 255, 255, 255]); + //player.SetSharedData("nameTagColor", new Color[255, 255, 255, 255]); UpdateCharacterCloth.LoadCharacterDefaults(player); } }