Merge
This commit is contained in:
@@ -7,19 +7,13 @@
|
|||||||
|
|
||||||
export default function playerBlips() {
|
export default function playerBlips() {
|
||||||
|
|
||||||
mp.events.add("entityStreamIn", (entity) => {
|
mp.events.add("entityStreamIn", (entity) => {
|
||||||
|
mp.game.wait(500);
|
||||||
if (entity.type === "player") {
|
if (entity.type === "player") {
|
||||||
|
|
||||||
var entityMp = <EntityMp>entity;
|
var entityMp = <EntityMp>entity;
|
||||||
|
|
||||||
|
|
||||||
let color = parseInt(entity.getVariable("blipColor"));
|
let color = parseInt(entity.getVariable("blipColor"));
|
||||||
|
|
||||||
|
|
||||||
entity.createBlip(1);
|
entity.createBlip(1);
|
||||||
|
|
||||||
var blip = entity.blip;
|
var blip = entity.blip;
|
||||||
|
|
||||||
entity.setBlipColor(isNaN(color) ? 0 : color);
|
entity.setBlipColor(isNaN(color) ? 0 : color);
|
||||||
|
|
||||||
mp.game.invoke(Natives.SET_BLIP_CATEGORY, entity.blip, 7);
|
mp.game.invoke(Natives.SET_BLIP_CATEGORY, entity.blip, 7);
|
||||||
@@ -31,7 +25,11 @@ export default function playerBlips() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
mp.events.add("entityStreamOut", (entity) => {
|
||||||
|
if (entity.type === "player") {
|
||||||
|
entity.blip = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
mp.events.addDataHandler("blipColor", (entity, value) => {
|
mp.events.addDataHandler("blipColor", (entity, value) => {
|
||||||
if (entity.type === "player") {
|
if (entity.type === "player") {
|
||||||
|
|||||||
@@ -31,8 +31,6 @@ const colors = [
|
|||||||
export default function customNametags() {
|
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;
|
||||||
@@ -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": {}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,14 +19,14 @@ export default function attachmentManager(game: IGame) {
|
|||||||
|
|
||||||
addFor: async function (entity, id) {
|
addFor: async function (entity, id) {
|
||||||
if (this.attachments.hasOwnProperty(id)) {
|
if (this.attachments.hasOwnProperty(id)) {
|
||||||
|
if (!entity.__attachmentObjects) {
|
||||||
|
entity.__attachmentObjects = {};
|
||||||
|
}
|
||||||
if (!entity.__attachmentObjects.hasOwnProperty(id)) {
|
if (!entity.__attachmentObjects.hasOwnProperty(id)) {
|
||||||
let attInfo = this.attachments[id];
|
let attInfo = this.attachments[id];
|
||||||
|
|
||||||
let object = mp.objects.new(attInfo.model, entity.position);
|
let object = mp.objects.new(attInfo.model, entity.position);
|
||||||
while (object.handle === 0) {
|
|
||||||
await mp.game.waitAsync(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
object.__attMgrData = {
|
object.__attMgrData = {
|
||||||
targetEntity: entity.handle,
|
targetEntity: entity.handle,
|
||||||
bone: (typeof (attInfo.boneName) === 'string') ? entity.getBoneIndexByName(attInfo.boneName) : entity.getBoneIndex(attInfo.boneName),
|
bone: (typeof (attInfo.boneName) === 'string') ? entity.getBoneIndexByName(attInfo.boneName) : entity.getBoneIndex(attInfo.boneName),
|
||||||
|
|||||||
@@ -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);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -218,8 +218,16 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
List<VehicleItem> vehicleItems = dbContext.VehicleItems.ToList().Where(f => f.GetVehicle().GetVehicle() == nearestBehindVehiclePoint.vehicle && InventoryManager.GetItemById(f.ItemId) is IWeaponDealItem).ToList();
|
List<VehicleItem> vehicleItems = dbContext.VehicleItems.ToList().Where(f => f.GetVehicle().GetVehicle() == nearestBehindVehiclePoint.vehicle && InventoryManager.GetItemById(f.ItemId) is IWeaponDealItem).ToList();
|
||||||
if (vehicleItems.Count == 0)
|
if (vehicleItems.Count == 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
GTANetworkAPI.Vehicle vehicle = nearestBehindVehiclePoint.vehicle;
|
GTANetworkAPI.Vehicle vehicle = nearestBehindVehiclePoint.vehicle;
|
||||||
|
|
||||||
|
if (vehicle.HasAttachment("weapondeal"))
|
||||||
|
{
|
||||||
|
vehicle.AddAttachment("weapondeal", true);
|
||||||
|
vehicle.AddAttachment("weapondeal1", true);
|
||||||
|
vehicle.AddAttachment("weapondeal2", true);
|
||||||
|
}
|
||||||
|
|
||||||
if (WeaponDealManager.checkWeaponDbyVehicle(vehicle))
|
if (WeaponDealManager.checkWeaponDbyVehicle(vehicle))
|
||||||
{
|
{
|
||||||
vehicle.ResetData("WeaponDealLoad");
|
vehicle.ResetData("WeaponDealLoad");
|
||||||
@@ -365,13 +373,11 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
|
|
||||||
using (var context = new DatabaseContext())
|
using (var context = new DatabaseContext())
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
if (player.HasAttachment("ammobox"))
|
if (player.HasAttachment("ammobox"))
|
||||||
{
|
{
|
||||||
player.AddAttachment("ammobox", true);
|
player.AddAttachment("ammobox", true);
|
||||||
player.StopAnimation();
|
player.StopAnimation();
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
bool unloadedWeaponPackage = false;
|
bool unloadedWeaponPackage = false;
|
||||||
|
|
||||||
List<UserItem> fItem = context.UserItems.Where(u => u.UserId == user.Id).ToList();
|
List<UserItem> fItem = context.UserItems.Where(u => u.UserId == user.Id).ToList();
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ namespace ReallifeGamemode.Server.Inventory
|
|||||||
if (!player.HasAttachment("ammobox"))
|
if (!player.HasAttachment("ammobox"))
|
||||||
{
|
{
|
||||||
player.PlayAnimation("anim@heists@box_carry@", "idle", 49);
|
player.PlayAnimation("anim@heists@box_carry@", "idle", 49);
|
||||||
//player.AddAttachment("ammobox", false);
|
player.AddAttachment("ammobox", false);
|
||||||
NAPI.Player.SetPlayerCurrentWeapon(player, WeaponHash.Unarmed);
|
NAPI.Player.SetPlayerCurrentWeapon(player, WeaponHash.Unarmed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -195,6 +195,12 @@ namespace ReallifeGamemode.Server.Job
|
|||||||
muellmanData.Remove(data);
|
muellmanData.Remove(data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (player.HasAttachment("binbag"))
|
||||||
|
{
|
||||||
|
player.AddAttachment("binbag", true);
|
||||||
|
}
|
||||||
|
|
||||||
ChatService.SendMessage(data.getPartnerClient(player), $"~y~[Job] ~s~Dein Partner hat den Job beendet.");
|
ChatService.SendMessage(data.getPartnerClient(player), $"~y~[Job] ~s~Dein Partner hat den Job beendet.");
|
||||||
|
|
||||||
data.removeClientFromData(player);
|
data.removeClientFromData(player);
|
||||||
@@ -211,7 +217,7 @@ namespace ReallifeGamemode.Server.Job
|
|||||||
Player target = data.getPartnerClient(player);
|
Player target = data.getPartnerClient(player);
|
||||||
if (target != null) target.TriggerEvent("MuellmannUpdateColshape", colshapeIndex);
|
if (target != null) target.TriggerEvent("MuellmannUpdateColshape", colshapeIndex);
|
||||||
player.TriggerEvent("renderTextOnScreen", "Wirf den Müllsack in den Müllwagen.");
|
player.TriggerEvent("renderTextOnScreen", "Wirf den Müllsack in den Müllwagen.");
|
||||||
//player.AddAttachment("binbag", false);
|
player.AddAttachment("binbag", false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -240,7 +246,7 @@ namespace ReallifeGamemode.Server.Job
|
|||||||
target.SendNotification("Müllsack: " + data.getTrashCount() + " von " + MAX_BAG + ".");
|
target.SendNotification("Müllsack: " + data.getTrashCount() + " von " + MAX_BAG + ".");
|
||||||
}
|
}
|
||||||
|
|
||||||
// player.AddAttachment("binbag", true);
|
player.AddAttachment("binbag", true);
|
||||||
|
|
||||||
if (data.getTrashCount() == MAX_BAG)
|
if (data.getTrashCount() == MAX_BAG)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -348,7 +348,7 @@ public class BehindVehiclePoint
|
|||||||
if (!player.HasAttachment("ammobox"))
|
if (!player.HasAttachment("ammobox"))
|
||||||
{
|
{
|
||||||
player.PlayAnimation("anim@heists@box_carry@", "idle", 49);
|
player.PlayAnimation("anim@heists@box_carry@", "idle", 49);
|
||||||
//player.AddAttachment("ammobox", false);
|
player.AddAttachment("ammobox", false);
|
||||||
NAPI.Player.SetPlayerCurrentWeapon(player, WeaponHash.Unarmed);
|
NAPI.Player.SetPlayerCurrentWeapon(player, WeaponHash.Unarmed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -97,7 +97,6 @@ public static class AttachmentSync
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
entity.ResetSharedData("attachmentsData");
|
|
||||||
entity.SetData("Attachments", new List<uint>());
|
entity.SetData("Attachments", new List<uint>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -185,6 +185,9 @@ namespace ReallifeGamemode.Server.WeaponDeal
|
|||||||
Vehicle fVeh = VehicleManager.GetVehicleFromServerVehicle(factionVehicle);
|
Vehicle fVeh = VehicleManager.GetVehicleFromServerVehicle(factionVehicle);
|
||||||
fVeh.SetData("weaponDeal", false);
|
fVeh.SetData("weaponDeal", false);
|
||||||
fVeh.SetData("WeaponDealLoad", true);
|
fVeh.SetData("WeaponDealLoad", true);
|
||||||
|
fVeh.AddAttachment("weapondeal", false);
|
||||||
|
fVeh.AddAttachment("weapondeal1", false);
|
||||||
|
fVeh.AddAttachment("weapondeal2", false);
|
||||||
InventoryManager.RemoveAllItemsfromVehicleInventory(fVeh);
|
InventoryManager.RemoveAllItemsfromVehicleInventory(fVeh);
|
||||||
int oMembers = NAPI.Pools.GetAllPlayers().Where(p => p.IsLoggedIn() && p.GetUser(context).FactionId == user.FactionId).Count();
|
int oMembers = NAPI.Pools.GetAllPlayers().Where(p => p.IsLoggedIn() && p.GetUser(context).FactionId == user.FactionId).Count();
|
||||||
|
|
||||||
|
|||||||
3
package-lock.json
generated
Normal file
3
package-lock.json
generated
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"lockfileVersion": 1
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user