Merge branch 'hotfix/medic' into develop
This commit is contained in:
@@ -133,11 +133,14 @@ export default function animationSync() {
|
|||||||
mp.events.callRemote("CLIENT:ClearAnimationData", false);
|
mp.events.callRemote("CLIENT:ClearAnimationData", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const blockInputControls = [12, 13, 14, 15, 22, 24, 25, 37, 261, 262];
|
||||||
|
|
||||||
mp.events.add("render", () => {
|
mp.events.add("render", () => {
|
||||||
|
mp.gui.chat.push("blockInput = " + blockInput);
|
||||||
if (blockInput) {
|
if (blockInput) {
|
||||||
mp.game.controls.disableControlAction(32, 25, true);
|
blockInputControls.forEach((ctrl) => {
|
||||||
mp.game.controls.disableControlAction(32, 24, true);
|
mp.game.controls.disableControlAction(32, ctrl, true);
|
||||||
mp.game.controls.disableControlAction(32, 22, true);
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -94,6 +94,8 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Medic.delHealTask(player);
|
||||||
|
|
||||||
if (user.JailTime <= 0)
|
if (user.JailTime <= 0)
|
||||||
{
|
{
|
||||||
user.Dead = true;
|
user.Dead = true;
|
||||||
@@ -113,7 +115,6 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
MedicName = "none"
|
MedicName = "none"
|
||||||
};
|
};
|
||||||
Medic.AddTaskToList(reviveTask);
|
Medic.AddTaskToList(reviveTask);
|
||||||
Medic.delHealTask(player);
|
|
||||||
ChatService.BroadcastFaction("~y~[MEDIC] ~w~" + player.Name + " ist soeben verstorben.", new List<int>() { 2 });
|
ChatService.BroadcastFaction("~y~[MEDIC] ~w~" + player.Name + " ist soeben verstorben.", new List<int>() { 2 });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -438,6 +438,7 @@ namespace ReallifeGamemode.Server.Extensions
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
player.SyncAnimation("hup");
|
player.SyncAnimation("hup");
|
||||||
|
NAPI.Player.SetPlayerCurrentWeapon(player, WeaponHash.Unarmed);
|
||||||
|
|
||||||
if (player.GetUser().Wanteds > 0)
|
if (player.GetUser().Wanteds > 0)
|
||||||
PositionManager.cuffPoints.Add(player);
|
PositionManager.cuffPoints.Add(player);
|
||||||
|
|||||||
@@ -263,7 +263,7 @@ namespace ReallifeGamemode.Server.Factions.Medic
|
|||||||
{
|
{
|
||||||
player.SetData("healauftrag", false);
|
player.SetData("healauftrag", false);
|
||||||
var medicPlayer = PlayerService.GetPlayerByNameOrId(task.MedicName);
|
var medicPlayer = PlayerService.GetPlayerByNameOrId(task.MedicName);
|
||||||
if (task.MedicName != "none")
|
if (medicPlayer != null)
|
||||||
{
|
{
|
||||||
medicPlayer.TriggerEvent("destroyMedicTaskCheckpoint");
|
medicPlayer.TriggerEvent("destroyMedicTaskCheckpoint");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -589,85 +589,76 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
public void InteractionMenu_LSPD_Points3(Player player, string jsonNameOrId, string jsoAmount, string jsonReason)
|
public void InteractionMenu_LSPD_Points3(Player player, string jsonNameOrId, string jsoAmount, string jsonReason)
|
||||||
{
|
{
|
||||||
string nameOrId = (string)JsonConvert.DeserializeObject(jsonNameOrId);
|
string nameOrId = (string)JsonConvert.DeserializeObject(jsonNameOrId);
|
||||||
int amount = Int32.Parse((string)JsonConvert.DeserializeObject(jsoAmount));
|
|
||||||
string reason = (string)JsonConvert.DeserializeObject(jsonReason);
|
string reason = (string)JsonConvert.DeserializeObject(jsonReason);
|
||||||
Player target = PlayerService.GetPlayerByNameOrId(nameOrId);
|
Player target = PlayerService.GetPlayerByNameOrId(nameOrId);
|
||||||
string playername = NAPI.Player.GetPlayerName(player);
|
string playername = NAPI.Player.GetPlayerName(player);
|
||||||
string targetname = NAPI.Player.GetPlayerName(target);
|
string targetname = NAPI.Player.GetPlayerName(target);
|
||||||
|
|
||||||
|
if (!int.TryParse((string)JsonConvert.DeserializeObject(jsoAmount), out int amount))
|
||||||
|
{
|
||||||
|
player.SendNotification("~r~Es muss eine gültige Zahl für die Punkte angegeben werden!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (target == null || !target.IsLoggedIn())
|
if (target == null || !target.IsLoggedIn())
|
||||||
{
|
{
|
||||||
ChatService.PlayerNotFound(player);
|
ChatService.PlayerNotFound(player);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (target.GetUser().DriverLicenseVehicle == false && target.GetUser().DriverLicenseBike == false)
|
|
||||||
{
|
if (target == player)
|
||||||
player.SendNotification("~r~Spieler hat weder Auto- noch Motorradführerschein!");
|
|
||||||
}
|
|
||||||
else if (target == player)
|
|
||||||
{
|
{
|
||||||
player.SendNotification("~r~Du kannst dir selbst keine Punkte setzen!");
|
player.SendNotification("~r~Du kannst dir selbst keine Punkte setzen!");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
using var dbContext = new DatabaseContext();
|
||||||
|
User targetUser = target.GetUser(dbContext);
|
||||||
|
|
||||||
|
if(targetUser == null)
|
||||||
{
|
{
|
||||||
if (amount > -13 && amount < 13)
|
ChatService.PlayerNotFound(player);
|
||||||
{
|
return;
|
||||||
using (var dbContext = new DatabaseContext())
|
|
||||||
{
|
|
||||||
User target2 = target.GetUser(dbContext);
|
|
||||||
target2.Points += amount;
|
|
||||||
dbContext.SaveChanges();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (targetUser.DriverLicenseVehicle == false && targetUser.DriverLicenseBike == false)
|
||||||
|
{
|
||||||
|
player.SendNotification("~r~Spieler hat weder Auto- noch Motorradführerschein!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (amount < -13 || amount > 13)
|
||||||
|
{
|
||||||
|
player.SendNotification("~r~Du kannst nur zwischen 1 und 12 Punkte verteilen!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
targetUser.Points += amount;
|
||||||
|
|
||||||
player.SendNotification($"~w~Du hast ~y~{targetname} ~b~{amount} ~w~Strafpunkte gegeben. Grund: ~g~{reason}~w~.");
|
player.SendNotification($"~w~Du hast ~y~{targetname} ~b~{amount} ~w~Strafpunkte gegeben. Grund: ~g~{reason}~w~.");
|
||||||
target.SendNotification($"~b~{player.GetUser().FactionRank.RankName} | {playername} ~w~hat dir ~y~{amount} ~w~Strafpunkte gegeben.", true);
|
target.SendNotification($"~b~{player.GetUser().FactionRank.RankName} | {playername} ~w~hat dir ~y~{amount} ~w~Strafpunkte gegeben.", true);
|
||||||
ChatService.BroadcastFaction("!{#8181E9}HQ: " + targetname + " hat von " + playername + " " + amount + " Strafpunkt(e) erhalten. Gesamt: " + target.GetUser().Points, new List<int>() { 1, 3 });
|
ChatService.HQMessage(targetname + " hat von " + playername + " " + amount + " Strafpunkt(e) erhalten. Gesamt: " + targetUser.Points);
|
||||||
if (target.GetUser().Points < 0)
|
|
||||||
|
if (targetUser.Points < 0)
|
||||||
{
|
{
|
||||||
using (var dbContext = new DatabaseContext())
|
targetUser.Points = 0;
|
||||||
{
|
|
||||||
User target2 = target.GetUser(dbContext);
|
|
||||||
target2.Points = 0;
|
|
||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
}
|
}
|
||||||
}
|
else if (targetUser.Points >= 12)
|
||||||
else if (target.GetUser().Points >= 12)
|
|
||||||
{
|
{
|
||||||
target.SendNotification($"~w~Grund: ~g~{reason}~w~. ~x~Du hast nun ~r~12/12 ~x~Strafpunkten.", true);
|
target.SendNotification($"~w~Grund: ~g~{reason}~w~. ~x~Du hast nun ~r~12/12 ~x~Strafpunkten.", true);
|
||||||
target.SendNotification($"~w~Dir wird ~r~Auto- ~w~und ~r~Motorradführerschein ~w~entzogen.", true); //FlashNotif
|
target.SendNotification($"~w~Dir wird ~r~Auto- ~w~und ~r~Motorradführerschein ~w~entzogen.", true); //FlashNotif
|
||||||
ChatService.HQMessage(targetname + "hat von" + playername + " " + amount + " Strafpunkt erhalten(e). Gesamt: " + target.GetUser().Points);
|
|
||||||
foreach (var copPlayer in NAPI.Pools.GetAllPlayers())
|
|
||||||
{
|
|
||||||
User copUser = copPlayer.GetUser();
|
|
||||||
if (copUser == null)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (copUser.FactionId == 1 || copUser.FactionId == 3)
|
|
||||||
{
|
|
||||||
if (copUser.GetData<bool>("duty") == true)
|
|
||||||
{
|
|
||||||
ChatService.HQMessage(targetname + " besitzt nun keinen Führerschein mehr.");
|
ChatService.HQMessage(targetname + " besitzt nun keinen Führerschein mehr.");
|
||||||
}
|
|
||||||
}
|
targetUser.Points = 0;
|
||||||
}
|
targetUser.DriverLicenseVehicle = false;
|
||||||
using (var dbContext = new DatabaseContext())
|
targetUser.DriverLicenseBike = false;
|
||||||
{
|
|
||||||
User target2 = target.GetUser(dbContext);
|
|
||||||
target2.Points = 0;
|
|
||||||
target2.DriverLicenseVehicle = false;
|
|
||||||
target2.DriverLicenseBike = false;
|
|
||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
target.SendNotification($"~w~Grund: ~g~{reason}~w~. ~x~Du hast nun ~y~{target.GetUser().Points}/12 ~x~Strafpunkten.", true);
|
target.SendNotification($"~w~Grund: ~g~{reason}~w~. ~x~Du hast nun ~y~{targetUser.Points}/12 ~x~Strafpunkten.", true);
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
player.SendNotification("~r~Du kannst nur zwischen 1 und 12 Punkte verteilen!");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user