fix postitioning of cuffs and delete cuffpoits on death

This commit is contained in:
2021-04-07 22:42:57 +02:00
parent a63185768c
commit 56ab0734ee
2 changed files with 11 additions and 11 deletions

View File

@@ -8,7 +8,7 @@ export default function attachmentManager(game: IGame) {
attachmentMngr.register("weapondeal", "ex_prop_crate_ammo_bc", "chassis_dummy", new mp.Vector3(0.08, -0.9, -0.2), new mp.Vector3(0, 0, 0));
attachmentMngr.register("weapondeal1", "ex_office_swag_guns02", "chassis_dummy", new mp.Vector3(0, 0.8, 0), new mp.Vector3(0, 0, 0));
attachmentMngr.register("weapondeal2", "w_sg_pumpshotgun", "chassis_dummy", new mp.Vector3(0.4, 1.6, 0.62), new mp.Vector3(90, 0, 180));
attachmentMngr.register("handcuffs", "p_cs_cuffs_02_s", 28422, new mp.Vector3(0, 0, 0), new mp.Vector3(0, 90, 0));
attachmentMngr.register("handcuffs", "p_cs_cuffs_02_s", 28422, new mp.Vector3(-0.05, 0, 0), new mp.Vector3(90, 90, 0));
});
const attachmentMngr =

View File

@@ -25,7 +25,7 @@ namespace ReallifeGamemode.Server.Events
public class Death : Script
{
[ServerEvent(Event.PlayerDeath)]
public void OnPlayerDeath(Player player, Player killer, uint reason )
public void OnPlayerDeath(Player player, Player killer, uint reason)
{
if (!player.IsLoggedIn())
{
@@ -33,19 +33,21 @@ namespace ReallifeGamemode.Server.Events
return;
}
PositionManager.cuffPoints.Remove(player);
player.SetData("isDead", true);
using (var userDeath = new DatabaseContext())
{
{
User userisdead = player.GetUser(userDeath);
userisdead.Dead = true;
userDeath.SaveChanges();
}
userDeath.SaveChanges();
}
//TODO: Zum Full Release entfernen
if (player.HasData("togdeath")) {
ChatService.SendMessage(player, "Du bist durch " + (killer?.Name ?? "Niemanden") + " gestorben: " + reason.ToString());
if (player.HasData("togdeath"))
{
ChatService.SendMessage(player, "Du bist durch " + (killer?.Name ?? "Niemanden") + " gestorben: " + reason.ToString());
}
int? killerId;
float killerPosX;
@@ -109,8 +111,6 @@ namespace ReallifeGamemode.Server.Events
ChatService.BroadcastFaction("~y~[MEDIC] ~w~" + player.Name + " ist soeben verstorben.", new List<int>() { 2 });
}
if (player.GetUser().IsAdmin(AdminLevel.ADMIN) == true)
{
player.TriggerEvent("startDeathTimer", true);