This commit is contained in:
VegaZ
2021-04-04 23:36:14 +02:00
15 changed files with 5608 additions and 55 deletions

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

@@ -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();
if (vehicleItems.Count == 0)
{
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))
{
vehicle.ResetData("WeaponDealLoad");
@@ -365,13 +373,11 @@ namespace ReallifeGamemode.Server.Events
using (var context = new DatabaseContext())
{
/*
if (player.HasAttachment("ammobox"))
{
player.AddAttachment("ammobox", true);
player.StopAnimation();
}
*/
bool unloadedWeaponPackage = false;
List<UserItem> fItem = context.UserItems.Where(u => u.UserId == user.Id).ToList();

View File

@@ -102,7 +102,7 @@ namespace ReallifeGamemode.Server.Inventory
if (!player.HasAttachment("ammobox"))
{
player.PlayAnimation("anim@heists@box_carry@", "idle", 49);
//player.AddAttachment("ammobox", false);
player.AddAttachment("ammobox", false);
NAPI.Player.SetPlayerCurrentWeapon(player, WeaponHash.Unarmed);
}
}

View File

@@ -195,6 +195,12 @@ namespace ReallifeGamemode.Server.Job
muellmanData.Remove(data);
return;
}
if (player.HasAttachment("binbag"))
{
player.AddAttachment("binbag", true);
}
ChatService.SendMessage(data.getPartnerClient(player), $"~y~[Job] ~s~Dein Partner hat den Job beendet.");
data.removeClientFromData(player);
@@ -211,7 +217,7 @@ namespace ReallifeGamemode.Server.Job
Player target = data.getPartnerClient(player);
if (target != null) target.TriggerEvent("MuellmannUpdateColshape", colshapeIndex);
player.TriggerEvent("renderTextOnScreen", "Wirf den Müllsack in den Müllwagen.");
//player.AddAttachment("binbag", false);
player.AddAttachment("binbag", false);
return;
}
}
@@ -240,7 +246,7 @@ namespace ReallifeGamemode.Server.Job
target.SendNotification("Müllsack: " + data.getTrashCount() + " von " + MAX_BAG + ".");
}
// player.AddAttachment("binbag", true);
player.AddAttachment("binbag", true);
if (data.getTrashCount() == MAX_BAG)
{

View File

@@ -348,7 +348,7 @@ public class BehindVehiclePoint
if (!player.HasAttachment("ammobox"))
{
player.PlayAnimation("anim@heists@box_carry@", "idle", 49);
//player.AddAttachment("ammobox", false);
player.AddAttachment("ammobox", false);
NAPI.Player.SetPlayerCurrentWeapon(player, WeaponHash.Unarmed);
}
}

View File

@@ -58,12 +58,9 @@ namespace ReallifeGamemode.Server.Services
{
User user = c.GetUser();
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)
{

View File

@@ -97,7 +97,6 @@ public static class AttachmentSync
}
}
entity.ResetSharedData("attachmentsData");
entity.SetData("Attachments", new List<uint>());
}

View File

@@ -185,6 +185,9 @@ namespace ReallifeGamemode.Server.WeaponDeal
Vehicle fVeh = VehicleManager.GetVehicleFromServerVehicle(factionVehicle);
fVeh.SetData("weaponDeal", false);
fVeh.SetData("WeaponDealLoad", true);
fVeh.AddAttachment("weapondeal", false);
fVeh.AddAttachment("weapondeal1", false);
fVeh.AddAttachment("weapondeal2", false);
InventoryManager.RemoveAllItemsfromVehicleInventory(fVeh);
int oMembers = NAPI.Pools.GetAllPlayers().Where(p => p.IsLoggedIn() && p.GetUser(context).FactionId == user.FactionId).Count();