This commit is contained in:
Lukas Moungos
2019-07-20 14:02:37 +02:00
parent 9630d97307
commit f80c0b7f64
2 changed files with 35 additions and 23 deletions

View File

@@ -1,5 +1,6 @@
using System;
using GTANetworkAPI;
using ReallifeGamemode.Server.Entities;
using ReallifeGamemode.Server.Extensions;
using ReallifeGamemode.Server.Factions.Medic;
using ReallifeGamemode.Server.Models;
@@ -76,23 +77,27 @@ namespace ReallifeGamemode.Server.Events
}
}
//MEDIC AUFTRAG
MedicTask reviveTask = new MedicTask()
User user = player.GetUser();
if(user.JailTime <= 0)
{
Victim = player.Name,
Position = player.Position,
CauseOfDeath = reason.ToString(),
Caller = null,
Description = "Gestorben",
Time = DateTime.Now,
Type = MedicTaskType.REVIVE,
MedicName = "none"
};
Medic.AddTaskToList(reviveTask);
//MEDIC AUFTRAG
MedicTask reviveTask = new MedicTask()
{
Victim = player.Name,
Position = player.Position,
CauseOfDeath = reason.ToString(),
Caller = null,
Description = "Gestorben",
Time = DateTime.Now,
Type = MedicTaskType.REVIVE,
MedicName = "none"
};
Medic.AddTaskToList(reviveTask);
//TODO PICTURE NOTIFICATION + SOUND für Medics
}
//TODO PICTURE NOTIFICATION + SOUND für Medics
using (var userDeath = new DatabaseContext())
{

View File

@@ -21,14 +21,22 @@ namespace ReallifeGamemode.Server.Wanted
User user = client.GetUser();
if (user.JailTime > 0)
{
client.SetData("isDead", false);
client.RemoveAllWeapons();
Random rnd = new Random();
int rndInt = rnd.Next(1, 3);
if (rndInt == 1)
client.Position = new Vector3(458.9842, -997.2126, 24.91485); //send client to jail
NAPI.Player.SpawnPlayer(client, new Vector3(458.9842, -997.2126, 24.91485)); //send client to jail
if (rndInt == 2)
client.Position = new Vector3(459.696, -994.3766, 24.91486); //send client to jail
NAPI.Player.SpawnPlayer(client, new Vector3(459.696, -994.3766, 24.91486)); //send client to jail
if (rndInt == 3)
client.Position = new Vector3(458.3372, -1001.258, 24.91485); //send client to jail
NAPI.Player.SpawnPlayer(client, new Vector3(458.3372, -1001.258, 24.91485)); //send client to jail
client.TriggerEvent("onPlayerRevived");
MedicTask task = Medic.ReviveTasks.FirstOrDefault(t => t.Victim == client.Name);
Medic.RemoveTaskFromList(task);
client.Health = 100;
Jailtime[user.Id] = user.JailTime; // 54 sec for each wanted star -> in total 45min for 50 Wanteds
return;
@@ -57,6 +65,8 @@ namespace ReallifeGamemode.Server.Wanted
dbContext.SaveChanges();
}
}
client.SetData("isDead", false);
client.RemoveAllWeapons();
Random rnd = new Random();
@@ -73,11 +83,8 @@ namespace ReallifeGamemode.Server.Wanted
Medic.RemoveTaskFromList(task);
client.Health = 100;
ChatService.BroadcastFaction("~r~HQ: " + user.Name + " wurde im Gefängnis zugewiesen.", new List<int>() { 1, 3 });
ChatService.SendMessage(client, "Du bist im Gefängnis für " + jailTime + " Sekunden.");
ChatService.BroadcastFaction("~r~HQ: " + user.Name + " wurde ins Gefängnis geliefert.", new List<int>() {1,3});
}
}
}