Fix Jail
This commit is contained in:
@@ -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,8 +77,9 @@ namespace ReallifeGamemode.Server.Events
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
User user = player.GetUser();
|
||||
if(user.JailTime <= 0)
|
||||
{
|
||||
//MEDIC AUFTRAG
|
||||
MedicTask reviveTask = new MedicTask()
|
||||
{
|
||||
@@ -93,6 +95,9 @@ namespace ReallifeGamemode.Server.Events
|
||||
Medic.AddTaskToList(reviveTask);
|
||||
|
||||
//TODO PICTURE NOTIFICATION + SOUND für Medics
|
||||
}
|
||||
|
||||
|
||||
|
||||
using (var userDeath = new DatabaseContext())
|
||||
{
|
||||
|
||||
@@ -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});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user