Merge branch 'develop' into 'master'

[HOTFIX] DaBaby

See merge request log-gtav/reallife-gamemode!33
This commit is contained in:
Siga
2021-04-04 02:06:54 +00:00
8 changed files with 55 additions and 25 deletions

View File

@@ -4,10 +4,24 @@ const height = 0.0065;
const border = 0.001; const border = 0.001;
const color = [73, 137, 0, 255]; const color = [73, 137, 0, 255];
var faction; var faction;
var playerColors = [];
export default function customNametags() { export default function customNametags() {
mp.nametags.enabled = false; mp.nametags.enabled = false;
/*
mp.events.addDataHandler("nameTagColor", (entity, value) => {
if (entity.type === "player") {
var color = JSON.parse(value);
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) => { mp.events.add('render', (nametags) => {
const graphics = mp.game.graphics; const graphics = mp.game.graphics;
@@ -26,11 +40,11 @@ export default function customNametags() {
var armour = player.getArmour() / 100; var armour = player.getArmour() / 100;
y -= scale * (0.005 * (screenRes.y / 1080)); y -= scale * (0.005 * (screenRes.y / 1080));
mp.game.graphics.drawText(player.name + " (" + player.remoteId + ")", [x, y], mp.game.graphics.drawText(player.name + " (" + player.remoteId + ")", [x, y],
{ {
font: 4, 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[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], scale: [0.4, 0.4],
outline: true, outline: true,
centre: false centre: false

View File

@@ -224,8 +224,10 @@ refuseCollector();
import PedCreator from './Ped/PedCreator'; import PedCreator from './Ped/PedCreator';
PedCreator(); PedCreator();
/*
import attachmentManager from './util/attachmentMngr'; import attachmentManager from './util/attachmentMngr';
attachmentManager(game); attachmentManager(game);
*/
import relativeVector from './util/relativevector'; import relativeVector from './util/relativevector';
relativeVector(); relativeVector();

View File

@@ -57,8 +57,8 @@ namespace ReallifeGamemode.Server.Bank
} }
private static void EntityEnterFactionBankColShape(ColShape colShape, Player client) 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) if (client.GetUser().FactionLeader == true)
{ {

View File

@@ -278,19 +278,24 @@ namespace ReallifeGamemode.Server.Events
{ {
//LSPD //LSPD
case 1: case 1:
nameTagColor = new Color(28, 134, 238); //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.SetSharedData("blipColor", 38); player.SetSharedData("blipColor", 38);
break; break;
//Medic //Medic
case 2: case 2:
nameTagColor = new Color(255, 0, 0); //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); player.SetSharedData("blipColor", 79);
break; break;
//FBI //FBI
case 3: case 3:
nameTagColor = new Color(173, 0, 118); //nameTagColor = new Color(173, 0, 118);
//player.SetSharedData("nameTagColor", new int[] { 173, 0, 118});
player.SetSharedData("blipColor", 72); player.SetSharedData("blipColor", 72);
player.SetAccessories(2, 2, 0); player.SetAccessories(2, 2, 0);
break; break;
@@ -326,6 +331,7 @@ namespace ReallifeGamemode.Server.Events
player.TriggerEvent("toggleDutyMode", false); player.TriggerEvent("toggleDutyMode", false);
Medic.UpdateDutyMedics(-1); Medic.UpdateDutyMedics(-1);
player.SetSharedData("blipColor", 0); player.SetSharedData("blipColor", 0);
//player.SetSharedData("nameTagColor", new Color[255, 255, 255, 255]);
UpdateCharacterCloth.LoadCharacterDefaults(player); UpdateCharacterCloth.LoadCharacterDefaults(player);
} }
} }

View File

@@ -104,14 +104,22 @@ namespace ReallifeGamemode.Server.Events
{ {
case null: case null:
player.SetSharedData("blipColor", 0); player.SetSharedData("blipColor", 0);
//player.SetSharedData("nameTagColor", new int[] { 255, 255, 255 });
break;
case 0:
player.SetSharedData("blipColor", 0);
//player.SetSharedData("nameTagColor", new int[] { 255, 255, 255 });
break; break;
case 8: case 8:
player.SetSharedData("blipColor", 83); player.SetSharedData("blipColor", 83);
//player.SetSharedData("nameTagColor", new int[]{171, 0, 207});
break; break;
case 7: case 7:
player.SetSharedData("blipColor", 52); player.SetSharedData("blipColor", 52);
//player.SetSharedData("nameTagColor", new int[] { 0, 54, 0});
break; break;
case 4: case 4:
@@ -119,6 +127,7 @@ namespace ReallifeGamemode.Server.Events
break; break;
case 9: case 9:
player.SetSharedData("blipColor", 25); player.SetSharedData("blipColor", 25);
//player.SetSharedData("nameTagColor", new int[] { 0, 166, 133});
break; break;
} }

View File

@@ -9,7 +9,6 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using GTANetworkAPI; using GTANetworkAPI;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json;
using ReallifeGamemode.Database.Entities; using ReallifeGamemode.Database.Entities;
using ReallifeGamemode.Database.Models; using ReallifeGamemode.Database.Models;
using ReallifeGamemode.Server.Extensions; using ReallifeGamemode.Server.Extensions;

View File

@@ -296,13 +296,13 @@ namespace ReallifeGamemode.Server.Job
if (target != null) if (target != null)
{ {
user1.Wage += 10; user1.Wage += 25;
user2.Wage += 10; user2.Wage += 25;
} }
else else
{ {
user1.Wage += 20; user1.Wage += 50;
} }
dbContext.SaveChanges(); dbContext.SaveChanges();
} }
@@ -331,12 +331,12 @@ namespace ReallifeGamemode.Server.Job
if (target != null) if (target != null)
{ {
user1.Wage += 100; user1.Wage += 250;
user2.Wage += 100; user2.Wage += 250;
} }
else else
{ {
user1.Wage += 200; user1.Wage += 500;
} }
user1.trashcount -= user1.trashcount; user1.trashcount -= user1.trashcount;

View File

@@ -9,11 +9,11 @@ namespace ReallifeGamemode.Server.Util
{ {
public class CheckPointHandle : Script public class CheckPointHandle : Script
{ {
public int BusSkill1RouteVerdienst = 500; public int BusSkill1RouteVerdienst = 1000;
public int BusSkill2RouteVerdienst = 650; public int BusSkill2RouteVerdienst = 1300;
public int BusSkill3RouteVerdienst = 800; public int BusSkill3RouteVerdienst = 1600;
public int PilotSkill1RouteVerdienst = 550; public int PilotSkill1RouteVerdienst = 1100;
public int PilotSkill2RouteVerdienst = 750; public int PilotSkill2RouteVerdienst = 1500;
public static List<CheckPointListForPlayer> listHandle = new List<CheckPointListForPlayer>(); public static List<CheckPointListForPlayer> listHandle = new List<CheckPointListForPlayer>();
public static void DeleteCheckpoints(Player player) public static void DeleteCheckpoints(Player player)
@@ -177,24 +177,24 @@ namespace ReallifeGamemode.Server.Util
{ {
if (user.GetData<string>("Route") == "Skill1Route1" || user.GetData<string>("Route") == "Skill1Route2" || user.GetData<string>("Route") == "Skill1Route3") if (user.GetData<string>("Route") == "Skill1Route1" || user.GetData<string>("Route") == "Skill1Route2" || user.GetData<string>("Route") == "Skill1Route3")
{ {
BusDriverJob.payWage(user, PilotSkill1RouteVerdienst / temp.list.Count()); PilotJob.payWage(user, PilotSkill1RouteVerdienst / temp.list.Count());
BusDriverJob.payWage(user, PilotSkill1RouteVerdienst / temp.list.Count()); PilotJob.payWage(user, PilotSkill1RouteVerdienst / temp.list.Count());
} }
if (user.GetData<string>("Route") == "Skill2Route1" || user.GetData<string>("Route") == "Skill2Route2" || user.GetData<string>("Route") == "Skill2Route3") if (user.GetData<string>("Route") == "Skill2Route1" || user.GetData<string>("Route") == "Skill2Route2" || user.GetData<string>("Route") == "Skill2Route3")
{ {
BusDriverJob.payWage(user, PilotSkill2RouteVerdienst / temp.list.Count()); PilotJob.payWage(user, PilotSkill2RouteVerdienst / temp.list.Count());
BusDriverJob.payWage(user, PilotSkill2RouteVerdienst / temp.list.Count()); PilotJob.payWage(user, PilotSkill2RouteVerdienst / temp.list.Count());
} }
} }
if (temp.checkPointsDone > 2) if (temp.checkPointsDone > 2)
{ {
if (user.GetData<string>("Route") == "Skill1Route1" || user.GetData<string>("Route") == "Skill1Route2" || user.GetData<string>("Route") == "Skill1Route3") if (user.GetData<string>("Route") == "Skill1Route1" || user.GetData<string>("Route") == "Skill1Route2" || user.GetData<string>("Route") == "Skill1Route3")
{ {
BusDriverJob.payWage(user, PilotSkill1RouteVerdienst / temp.list.Count()); PilotJob.payWage(user, PilotSkill1RouteVerdienst / temp.list.Count());
} }
if (user.GetData<string>("Route") == "Skill2Route1" || user.GetData<string>("Route") == "Skill2Route2" || user.GetData<string>("Route") == "Skill2Route3") if (user.GetData<string>("Route") == "Skill2Route1" || user.GetData<string>("Route") == "Skill2Route2" || user.GetData<string>("Route") == "Skill2Route3")
{ {
BusDriverJob.payWage(user, PilotSkill2RouteVerdienst / temp.list.Count()); PilotJob.payWage(user, PilotSkill2RouteVerdienst / temp.list.Count());
} }
} }
//PilotJob.payWage(user, 100); //PilotJob.payWage(user, 100);