Testserver push

This commit is contained in:
2021-04-07 01:08:22 +02:00
parent e34cd3bd01
commit 52bb80a70a
9 changed files with 70 additions and 61 deletions

View File

@@ -1,7 +1,6 @@
import { IGame, IEntity } from "../game"; import { IGame, IEntity } from "../game";
import game from ".."; import game from "..";
const maxDistance = 40 * 40; const maxDistance = 40 * 40;
const width = 0.03; const width = 0.03;
const height = 0.0065; const height = 0.0065;
@@ -27,9 +26,7 @@ const colors = [
{ id: 9, color: [0, 166, 133, alpha] }, //news { id: 9, color: [0, 166, 133, alpha] }, //news
]; ];
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) => {
@@ -67,19 +64,19 @@ export default function customNametags() {
let y2 = y + 0.042; let y2 = y + 0.042;
if (armour > 0) { if (armour > 0) {
graphics.drawRect(x, y2, width + border * 2, height + border * 2, 0 , 0, 0, 200); graphics.drawRect(x, y2, width + border * 2, height + border * 2, 0, 0, 0, 200);
graphics.drawRect(x, y2, width, height, 150, 150, 150, 255); graphics.drawRect(x, y2, width, height, 50, 0, 0, 255);
graphics.drawRect(x - width / 2 * (1 - health), y2, width * health, height, 200, 0, 0, 200); graphics.drawRect(x - width / 2 * (1 - health), y2, width * health, height, 200, 0, 0, 200);
var x2 = x + width / 2 + border / 2; var x2 = x + width / 2 + border / 2;
graphics.drawRect(x, y2 + height, width + border * 2, height + border * 2, 0, 0, 0, 200); graphics.drawRect(x, y2 + height, width + border * 2, height + border * 2, 0, 0, 0, 200);
graphics.drawRect(x, y2 + height, width, height, 200, 200, 200, 255); graphics.drawRect(x, y2 + height, width, height, 80, 80, 80, 255);
graphics.drawRect(x - width / 2 * (1 - armour), y2 + height, width * armour, height, 255, 255, 255, 200); graphics.drawRect(x - width / 2 * (1 - armour), y2 + height, width * armour, height, 255, 255, 255, 200);
} }
else { else {
graphics.drawRect(x, y2, width + border * 2, height + border * 2, 0, 0, 0, 200); graphics.drawRect(x, y2, width + border * 2, height + border * 2, 0, 0, 0, 200);
graphics.drawRect(x, y2, width, height, 150, 150, 150, 255); graphics.drawRect(x, y2, width, height, 50, 0, 0, 255);
graphics.drawRect(x - width / 2 * (1 - health), y2, width * health, height, 200, 0, 0, 200); graphics.drawRect(x - width / 2 * (1 - health), y2, width * health, height, 200, 0, 0, 200);
} }
} }

View File

@@ -6,11 +6,9 @@
//https://docs.microsoft.com/de-de/windows/desktop/inputdev/virtual-key-codes //https://docs.microsoft.com/de-de/windows/desktop/inputdev/virtual-key-codes
const player = mp.players.local; const player = mp.players.local;
export default function keys(globalData: IGlobalData) { export default function keys(globalData: IGlobalData) {
var showGui = true; var showGui = true;
//ENTER //ENTER
@@ -73,7 +71,6 @@ export default function keys(globalData: IGlobalData) {
} }
}); });
//I //Inventar //I //Inventar
mp.keys.bind(0x49, false, function () { mp.keys.bind(0x49, false, function () {
if (!globalData.InChat && !globalData.InTuning) { if (!globalData.InChat && !globalData.InTuning) {
@@ -83,9 +80,9 @@ export default function keys(globalData: IGlobalData) {
//O //Spielerliste //O //Spielerliste
mp.keys.bind(0x4F, true, function () { mp.keys.bind(0x4F, true, function () {
if (!globalData.InChat && !globalData.InTuning ) { if (!globalData.InChat && !globalData.InTuning) {
mp.events.callRemote("keyPress:O"); mp.events.callRemote("keyPress:O");
//mp.events.call("showPlayerlist"); //mp.events.call("showPlayerlist");
} }
}); });
@@ -113,7 +110,7 @@ export default function keys(globalData: IGlobalData) {
//N //Motor Starten //N //Motor Starten
mp.keys.bind(0x4E, false, function () { mp.keys.bind(0x4E, false, function () {
if (!globalData.InChat) { if (!globalData.InChat) {
mp.events.callRemote("keyPress:N"); mp.events.callRemote("keyPress:N");
} }
}); });
@@ -143,9 +140,16 @@ export default function keys(globalData: IGlobalData) {
mp.gui.takeScreenshot(new Date().toLocaleDateString(), 1, 100, 80); mp.gui.takeScreenshot(new Date().toLocaleDateString(), 1, 100, 80);
}); });
//H
mp.keys.bind(0x48, false, function () {
if (mp.keys.isDown(0x11)) { //CTRL
mp.events.call("keyPress:ControllH"); //hup
return;
}
});
//F2 //Noclip //F2 //Noclip
mp.keys.bind(0x71, false, () => { mp.keys.bind(0x71, false, () => {
mp.events.callRemote("Noclip"); mp.events.callRemote("Noclip");
}); });
} }

View File

@@ -7,6 +7,8 @@
animationSyncData.register("getArrest", "mp_arrest_paired", "crook_p2_back_right", 3760, false, 0); animationSyncData.register("getArrest", "mp_arrest_paired", "crook_p2_back_right", 3760, false, 0);
animationSyncData.register("doUncuff", "mp_arresting", "a_uncuff", 5500, false, 0); animationSyncData.register("doUncuff", "mp_arresting", "a_uncuff", 5500, false, 0);
animationSyncData.register("getUncuff", "mp_arresting", "b_uncuff", 5500, false, 0); animationSyncData.register("getUncuff", "mp_arresting", "b_uncuff", 5500, false, 0);
animationSyncData.register("hup", "mp_am_hold_up", "handsup_base", -1, true, 50);
animationSyncData.register("carryBox", "anim@heists@box_carry@", "idle", -1, true, 50);
}); });
const animationSyncData = const animationSyncData =

View File

@@ -16,14 +16,12 @@ namespace ReallifeGamemode.Server.Commands
{ {
internal class UserCommands : Script internal class UserCommands : Script
{ {
[Command("skill")] [Command("skill")]
public void CmdUserSkill(Player player) public void CmdUserSkill(Player player)
{ {
User user = player.GetUser(new DatabaseContext()); User user = player.GetUser(new DatabaseContext());
player.SendChatMessage($"~c~BusSkill = {user.BusSkill}/800, PilotSkill = {user.PilotSkill}/300."); player.SendChatMessage($"~c~BusSkill = {user.BusSkill}/800, PilotSkill = {user.PilotSkill}/300.");
} }
[Command("id", "~m~Benutzung: ~s~/id [Name]")] [Command("id", "~m~Benutzung: ~s~/id [Name]")]
@@ -34,7 +32,8 @@ namespace ReallifeGamemode.Server.Commands
if (target == null) if (target == null)
{ {
player.SendChatMessage("~c~Spieler ist nicht online."); player.SendChatMessage("~c~Spieler ist nicht online.");
} else }
else
{ {
player.SendChatMessage("~c~ID: (" + target.Id + ") " + target.Name); player.SendChatMessage("~c~ID: (" + target.Id + ") " + target.Name);
} }
@@ -90,6 +89,7 @@ namespace ReallifeGamemode.Server.Commands
ChatService.SendMessage(player, "~m~" + ((VehicleHash)pVeh.Model) + " | Farbe 1: " + pVeh.PrimaryColor + " | Farbe 2: " + pVeh.SecondaryColor + " | ID: " + pVeh.Handle.Value); ChatService.SendMessage(player, "~m~" + ((VehicleHash)pVeh.Model) + " | Farbe 1: " + pVeh.PrimaryColor + " | Farbe 2: " + pVeh.SecondaryColor + " | ID: " + pVeh.Handle.Value);
} }
} }
[Command("help", "~m~Benutzung: ~s~/help")] [Command("help", "~m~Benutzung: ~s~/help")]
public void CmdHelp(Player player) public void CmdHelp(Player player)
{ {
@@ -106,8 +106,10 @@ namespace ReallifeGamemode.Server.Commands
[Command("hup")] [Command("hup")]
public void CmdAnim(Player player) public void CmdAnim(Player player)
{ {
player.StopAnimation(); if (player.HasAnimation())
player.PlayAnimation("mp_am_hold_up", "handsup_base", (int)(AnimationFlags.Loop | AnimationFlags.OnlyAnimateUpperBody | AnimationFlags.AllowPlayerControl | AnimationFlags.Cancellable)); return;
player.SyncAnimation("hup");
ChatService.SendInRange(player.Position, 20, $"~m~{player.Name} stellt sich..."); ChatService.SendInRange(player.Position, 20, $"~m~{player.Name} stellt sich...");
} }
@@ -119,9 +121,7 @@ namespace ReallifeGamemode.Server.Commands
ChatService.NotAuthorized(player); ChatService.NotAuthorized(player);
return; return;
} }
ChatService.BroadcastFaction("~b~[Event] " + player.Name + ": " + msg, new List<int>() { 9 }) ; ChatService.BroadcastFaction("~b~[Event] " + player.Name + ": " + msg, new List<int>() { 9 });
} }
} }
} }

View File

@@ -30,6 +30,7 @@ namespace ReallifeGamemode.Server.Events
public class Key : Script public class Key : Script
{ {
#region User Key #region User Key
[RemoteEvent("keyPress:NUM2")] [RemoteEvent("keyPress:NUM2")]
public void KeyPressNUM2(Player player) public void KeyPressNUM2(Player player)
{ {
@@ -60,6 +61,7 @@ namespace ReallifeGamemode.Server.Events
GroundItem.PickUpGroundItem(player); GroundItem.PickUpGroundItem(player);
} }
/* /*
[RemoteEvent("keyPress:LEFT_ARROW")] [RemoteEvent("keyPress:LEFT_ARROW")]
public void KeyPressLeftArrow(Player player) public void KeyPressLeftArrow(Player player)
@@ -85,6 +87,7 @@ namespace ReallifeGamemode.Server.Events
} }
} }
*/ */
[RemoteEvent("keyPress:RIGHT_ARROW")] [RemoteEvent("keyPress:RIGHT_ARROW")]
public void KeyPressRightArrow(Player player) public void KeyPressRightArrow(Player player)
{ {
@@ -115,7 +118,7 @@ namespace ReallifeGamemode.Server.Events
{ {
using var dbContext = new DatabaseContext(); using var dbContext = new DatabaseContext();
User u = player.GetUser(dbContext); User u = player.GetUser(dbContext);
if (u == null) return; if (u == null) return;
if (player.GetData<bool>("isDead")) return; if (player.GetData<bool>("isDead")) return;
var vehicles = dbContext.UserVehicles.Where(veh => veh.UserId == u.Id).OrderBy(veh => veh.Id).Select(v => new var vehicles = dbContext.UserVehicles.Where(veh => veh.UserId == u.Id).OrderBy(veh => veh.Id).Select(v => new
@@ -169,7 +172,7 @@ namespace ReallifeGamemode.Server.Events
int pay_amount = 0; int pay_amount = 0;
bool house = false; bool house = false;
if(u.House != null) if (u.House != null)
{ {
house = true; house = true;
} }
@@ -185,7 +188,6 @@ namespace ReallifeGamemode.Server.Events
} }
player.TriggerEvent("SERVER:InteractionMenu_OpenMenu", JsonConvert.SerializeObject(accountData), factionleader, faction, group, factionInvite, groupInvite, ticket_boolean, ticket_amount, pay_amount, house); player.TriggerEvent("SERVER:InteractionMenu_OpenMenu", JsonConvert.SerializeObject(accountData), factionleader, faction, group, factionInvite, groupInvite, ticket_boolean, ticket_amount, pay_amount, house);
} }
[RemoteEvent("keyPress:E")] [RemoteEvent("keyPress:E")]
@@ -194,16 +196,15 @@ namespace ReallifeGamemode.Server.Events
if (!player.IsLoggedIn()) return; if (!player.IsLoggedIn()) return;
var user = player.GetUser(); var user = player.GetUser();
if (player.HasData("nearATM")) if (player.HasData("nearATM"))
{ {
ATMManager.ShowAtmUi(player, player.GetData<int>("nearATM")); ATMManager.ShowAtmUi(player, player.GetData<int>("nearATM"));
return; return;
} }
if(!player.IsInVehicle) if (!player.IsInVehicle)
{ {
if(GroundItem.PickUpGroundItem(player)) if (GroundItem.PickUpGroundItem(player))
{ {
return; return;
} }
@@ -217,7 +218,7 @@ namespace ReallifeGamemode.Server.Events
FriseurPoint nearestFriseurPoint = PositionManager.friseurPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5 && (!user.GetData<bool>("duty"))); FriseurPoint nearestFriseurPoint = PositionManager.friseurPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5 && (!user.GetData<bool>("duty")));
ItemshopPoint nearestItemShopPoint = PositionManager.itemshopPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5); ItemshopPoint nearestItemShopPoint = PositionManager.itemshopPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5);
JobPoint nearestJobPoint = PositionManager.JobPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.6); JobPoint nearestJobPoint = PositionManager.JobPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.6);
if (user?.FactionId != null) if (user?.FactionId != null)
{ {
BehindVehiclePoint nearestBehindVehiclePoint = MarkerBehinVehicle.behindVehiclePoints.Find(s => s.marker.Position.DistanceTo(player.Position) <= 3 && (user.FactionId == 8 || user.FactionId == 7 || user.FactionId == 1 || user.FactionId == 3)); BehindVehiclePoint nearestBehindVehiclePoint = MarkerBehinVehicle.behindVehiclePoints.Find(s => s.marker.Position.DistanceTo(player.Position) <= 3 && (user.FactionId == 8 || user.FactionId == 7 || user.FactionId == 1 || user.FactionId == 3));
@@ -229,7 +230,6 @@ 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")) if (vehicle.HasAttachment("weapondeal"))
@@ -367,7 +367,7 @@ namespace ReallifeGamemode.Server.Events
if (player.HasAttachment("ammobox")) if (player.HasAttachment("ammobox"))
{ {
player.AddAttachment("ammobox", true); player.AddAttachment("ammobox", true);
player.StopAnimation(); player.ClearAnimation();
} }
bool unloadedWeaponPackage = false; bool unloadedWeaponPackage = false;
@@ -430,13 +430,12 @@ namespace ReallifeGamemode.Server.Events
if (user.FactionRank.Order >= weapon.Rank) if (user.FactionRank.Order >= weapon.Rank)
specials.Add(weapon.WeaponModel.ToString()); specials.Add(weapon.WeaponModel.ToString());
break; break;
case 5: case 5:
if (user.FactionRank.Order >= weapon.Rank) if (user.FactionRank.Order >= weapon.Rank)
armor.Add(weapon.WeaponModel.ToString()); armor.Add(weapon.WeaponModel.ToString());
break; break;
} }
} }
foreach (var weapon in weapons) foreach (var weapon in weapons)
{ {
@@ -496,7 +495,7 @@ namespace ReallifeGamemode.Server.Events
foreach (Player target in NAPI.Pools.GetAllPlayers()) foreach (Player target in NAPI.Pools.GetAllPlayers())
{ {
User c = target.GetUser(); User c = target.GetUser();
if(c == null) if (c == null)
{ {
continue; continue;
} }
@@ -556,7 +555,7 @@ namespace ReallifeGamemode.Server.Events
player.TriggerEvent("renderTextOnScreen", "Steige nun in eines der Fahrzeuge und starte den Motor mit der Taste 'N'."); player.TriggerEvent("renderTextOnScreen", "Steige nun in eines der Fahrzeuge und starte den Motor mit der Taste 'N'.");
return; return;
} }
} }
else if (nearestJobPoint.jobId == 3 && player.GetUser().JobId == 3) else if (nearestJobPoint.jobId == 3 && player.GetUser().JobId == 3)
{ {
if (nearestJobPoint.Skill < 300 && player.GetUser().PilotSkill >= 0) if (nearestJobPoint.Skill < 300 && player.GetUser().PilotSkill >= 0)
@@ -679,7 +678,6 @@ namespace ReallifeGamemode.Server.Events
player.TriggerEvent("SERVER:Job_ShowJobMenu", job.Name, json); player.TriggerEvent("SERVER:Job_ShowJobMenu", job.Name, json);
} }
[RemoteEvent("keyPress:O")] [RemoteEvent("keyPress:O")]
public void KeyPressO(Player player) public void KeyPressO(Player player)
{ {
@@ -688,13 +686,13 @@ namespace ReallifeGamemode.Server.Events
List<Player> players = NAPI.Pools.GetAllPlayers().Where(p => p.IsLoggedIn() == true).OrderBy(o => o.Handle.Value).ToList(); List<Player> players = NAPI.Pools.GetAllPlayers().Where(p => p.IsLoggedIn() == true).OrderBy(o => o.Handle.Value).ToList();
var listPlayers = players.Select(p => new var listPlayers = players.Select(p => new
{ {
Id = p.Handle.Value, Id = p.Handle.Value,
p.Name, p.Name,
p.Ping, p.Ping,
FactionName = p.GetUser()?.Faction?.Name ?? "Zivilist", FactionName = p.GetUser()?.Faction?.Name ?? "Zivilist",
}); });
player.TriggerEvent("showPlayerlist", JsonConvert.SerializeObject(listPlayers)); player.TriggerEvent("showPlayerlist", JsonConvert.SerializeObject(listPlayers));
} }
[RemoteEvent("keyPress:K")] [RemoteEvent("keyPress:K")]
@@ -801,9 +799,9 @@ namespace ReallifeGamemode.Server.Events
} }
else if (sV is FactionVehicle fV) else if (sV is FactionVehicle fV)
{ {
if(fV.Model == VehicleHash.Burrito3 && u.FactionId == 1 if (fV.Model == VehicleHash.Burrito3 && u.FactionId == 1
|| fV.Model == VehicleHash.Burrito3 && u.FactionId == 3 || fV.Model == VehicleHash.Burrito3 && u.FactionId == 3
|| fV.Model == VehicleHash.Burrito3 && u.FactionId == 7 || fV.Model == VehicleHash.Burrito3 && u.FactionId == 7
|| fV.Model == VehicleHash.Burrito3 && u.FactionId == 8 || fV.Model == VehicleHash.Burrito3 && u.FactionId == 8
|| fV.Model == VehicleHash.Policet && u.FactionId == 1 || fV.Model == VehicleHash.Policet && u.FactionId == 1
|| fV.Model == VehicleHash.Policet && u.FactionId == 3 || fV.Model == VehicleHash.Policet && u.FactionId == 3
@@ -967,8 +965,17 @@ namespace ReallifeGamemode.Server.Events
player.TriggerEvent("ToggleVehicleMenu"); player.TriggerEvent("ToggleVehicleMenu");
} }
} }
#endregion
#region Faction Key [RemoteEvent("keyPress:ControllH")]
#endregion public void KeyPressControllH(Player player)
{
if (player.HasAnimation())
return;
player.SyncAnimation("hup");
ChatService.SendInRange(player.Position, 20, $"~m~{player.Name} stellt sich...");
}
#endregion User Key
} }
} }

View File

@@ -6,6 +6,7 @@ using ReallifeGamemode.Database.Models;
using ReallifeGamemode.Server.Extensions; using ReallifeGamemode.Server.Extensions;
using ReallifeGamemode.Server.Inventory.Interfaces; using ReallifeGamemode.Server.Inventory.Interfaces;
using ReallifeGamemode.Server.Managers; using ReallifeGamemode.Server.Managers;
using ReallifeGamemode.Server.Util;
namespace ReallifeGamemode.Server.Inventory namespace ReallifeGamemode.Server.Inventory
{ {
@@ -99,9 +100,9 @@ namespace ReallifeGamemode.Server.Inventory
} }
if (nearestItem is IWeaponDealItem obj) if (nearestItem is IWeaponDealItem obj)
{ {
if (!player.HasAttachment("ammobox")) if (!player.HasAttachment("ammobox") && !player.HasAnimation())
{ {
player.PlayAnimation("anim@heists@box_carry@", "idle", 49); player.SyncAnimation("carryBox");
player.AddAttachment("ammobox", false); player.AddAttachment("ammobox", false);
NAPI.Player.SetPlayerCurrentWeapon(player, WeaponHash.Unarmed); NAPI.Player.SetPlayerCurrentWeapon(player, WeaponHash.Unarmed);
} }

View File

@@ -4,6 +4,7 @@ using GTANetworkAPI;
using ReallifeGamemode.Server.Shop.Clothing; using ReallifeGamemode.Server.Shop.Clothing;
using ReallifeGamemode.Server.Shop.SevenEleven; using ReallifeGamemode.Server.Shop.SevenEleven;
using ReallifeGamemode.Server.Shop.Friseur; using ReallifeGamemode.Server.Shop.Friseur;
using ReallifeGamemode.Server.Util;
namespace ReallifeGamemode.Server.Managers namespace ReallifeGamemode.Server.Managers
{ {
@@ -18,8 +19,8 @@ namespace ReallifeGamemode.Server.Managers
public static List<ElevatorPoint> ElevatorPoints = new List<ElevatorPoint>(); public static List<ElevatorPoint> ElevatorPoints = new List<ElevatorPoint>();
public static List<ClotheshopPoint> clotheshopPoints = new List<ClotheshopPoint>(); public static List<ClotheshopPoint> clotheshopPoints = new List<ClotheshopPoint>();
public static List<FriseurPoint> friseurPoints = new List<FriseurPoint>(); public static List<FriseurPoint> friseurPoints = new List<FriseurPoint>();
public static List<ItemshopPoint> itemshopPoints = new List<ItemshopPoint>(); public static List<ItemshopPoint> itemshopPoints = new List<ItemshopPoint>();
@@ -213,6 +214,7 @@ namespace ReallifeGamemode.Server.Managers
NAPI.Blip.CreateBlip(513, p.Position, 1f, 16, "Busfahrer", 255, 0, true); NAPI.Blip.CreateBlip(513, p.Position, 1f, 16, "Busfahrer", 255, 0, true);
} }
} }
#endregion JobPoints #endregion JobPoints
#region Shops #region Shops
@@ -285,7 +287,6 @@ namespace ReallifeGamemode.Server.Managers
return; return;
} }
player.Position = ElevatorPoints.Where(e => e.Stage == level).First().Position; player.Position = ElevatorPoints.Where(e => e.Stage == level).First().Position;
} }
} }
@@ -347,7 +348,7 @@ public class BehindVehiclePoint
{ {
if (!player.HasAttachment("ammobox")) if (!player.HasAttachment("ammobox"))
{ {
player.PlayAnimation("anim@heists@box_carry@", "idle", 49); player.SyncAnimation("carryBox");
player.AddAttachment("ammobox", false); player.AddAttachment("ammobox", false);
NAPI.Player.SetPlayerCurrentWeapon(player, WeaponHash.Unarmed); NAPI.Player.SetPlayerCurrentWeapon(player, WeaponHash.Unarmed);
} }
@@ -389,7 +390,6 @@ public class JobPoint
public Vector3 Position { get; set; } public Vector3 Position { get; set; }
public int jobId { get; set; } public int jobId { get; set; }
public int Skill { get; set; } public int Skill { get; set; }
} }
public class ElevatorPoint public class ElevatorPoint

View File

@@ -30,8 +30,6 @@ namespace ReallifeGamemode.Server.Util
{ {
string animationName = animations.ElementAt(0); string animationName = animations.ElementAt(0);
List<string> nextAnimations = animations.Skip(1).ToList(); List<string> nextAnimations = animations.Skip(1).ToList();
nextAnimations.ForEach(s => player.SendChatMessage(s));
player.SyncAnimation(animationName); player.SyncAnimation(animationName);
if (nextAnimations.Count != 0) if (nextAnimations.Count != 0)

View File

@@ -142,13 +142,13 @@ public class AttachmentSyncExample : Script
if (!player.HasAttachment("ammobox")) if (!player.HasAttachment("ammobox"))
{ {
player.AddAttachment("ammobox", false); player.AddAttachment("ammobox", false);
player.PlayAnimation("anim@heists@box_carry@", "idle", 49); //player.SyncAnimation("carryBox");
//veh.AddAttachment("weapondeal1", false); //veh.AddAttachment("weapondeal1", false);
//veh.AddAttachment("weapondeal2", false); //veh.AddAttachment("weapondeal2", false);
} }
else else
{ {
player.StopAnimation(); player.ClearAnimation();
player.ClearAttachments(); player.ClearAttachments();
} }