Fix Medic 7
This commit is contained in:
@@ -26,7 +26,6 @@ export default function factionInteraction(globalData: IGlobalData) {
|
||||
var sortText;
|
||||
var deadRespawned = false;
|
||||
var timeLeft = null;
|
||||
var deathTime;
|
||||
|
||||
var ticketName: string;
|
||||
var pointsName: string;
|
||||
@@ -324,7 +323,6 @@ export default function factionInteraction(globalData: IGlobalData) {
|
||||
dimension: 0
|
||||
});
|
||||
reviveTaskMenuMedic.Close();
|
||||
deathTime = tasks[index].TimeLeft;
|
||||
mp.gui.chat.activate(true);
|
||||
globalData.InMenu = false;
|
||||
ambulanceImagePos = 0.325
|
||||
@@ -332,7 +330,6 @@ export default function factionInteraction(globalData: IGlobalData) {
|
||||
taskFinish = tasks[index].Position;
|
||||
taskRange = mp.game.gameplay.getDistanceBetweenCoords(player.position.x, player.position.y, player.position.z, tasks[index].Position.x, tasks[index].Position.y, tasks[index].Position.z, true);
|
||||
activeTask = tasks[index];
|
||||
mp.events.callRemote("getTaskTimeLeft", tasks[index].Victim);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -503,6 +500,7 @@ export default function factionInteraction(globalData: IGlobalData) {
|
||||
});
|
||||
|
||||
mp.events.add('render', () => {
|
||||
|
||||
if (activeTask) {
|
||||
rangeLeft = mp.game.gameplay.getDistanceBetweenCoords(player.position.x, player.position.y, player.position.z, taskFinish.x, taskFinish.y, taskFinish.z, true).toFixed(2);
|
||||
if (rangeLeft > 1.9) {
|
||||
@@ -526,6 +524,7 @@ export default function factionInteraction(globalData: IGlobalData) {
|
||||
|
||||
var currentDate = new Date();
|
||||
|
||||
if (timeLeft != null) {
|
||||
if (deadRespawned == false) {
|
||||
//timeLeft = Math.round(Math.abs(Math.floor(currentDate.getTime() / 1000) - activeTask.TimeLeft - 60));
|
||||
if (timeLeft < 60) mp.events.call("cutMedicEarnings");
|
||||
@@ -535,10 +534,10 @@ export default function factionInteraction(globalData: IGlobalData) {
|
||||
}
|
||||
|
||||
if (deadRespawned == false) {
|
||||
mp.game.graphics.drawText(timeLeft + "s ", [0.5, 0.88], {
|
||||
mp.game.graphics.drawText(timeLeft + "s", [0.5, 0.88], {
|
||||
font: 7,
|
||||
color: [60, 179, 113, 255],
|
||||
scale: [0.3, 0.3],
|
||||
scale: [0.5, 0.5],
|
||||
outline: true,
|
||||
centre: true
|
||||
});
|
||||
@@ -547,12 +546,13 @@ export default function factionInteraction(globalData: IGlobalData) {
|
||||
mp.game.graphics.drawText(timeLeft + "s", [0.5, 0.88], {
|
||||
font: 7,
|
||||
color: [255, 203, 145, 255],
|
||||
scale: [0.3, 0.3],
|
||||
scale: [0.5, 0.5],
|
||||
outline: true,
|
||||
centre: true
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1726,7 +1726,29 @@ namespace ReallifeGamemode.Server.Commands
|
||||
#endregion Admin
|
||||
|
||||
#region ALevel1337
|
||||
|
||||
/* NUR ZUM TESTEN
|
||||
[Command("fakedeath", "~m~Benutzung:~s~ /fakedeath")]
|
||||
public void CmdAdmFakeDeath(Player player)
|
||||
{
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.PROJEKTLEITUNG) ?? true)
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
}
|
||||
MedicTask reviveTask = new MedicTask()
|
||||
{
|
||||
Victim = player.Name,
|
||||
Position = player.Position,
|
||||
CauseOfDeath = "FAKE",
|
||||
Caller = null,
|
||||
Description = "Gestorben",
|
||||
Time = DateTime.Now,
|
||||
Type = MedicTaskType.REVIVE,
|
||||
MedicName = "none"
|
||||
};
|
||||
Medic.AddTaskToList(reviveTask);
|
||||
}
|
||||
*/
|
||||
[Command("setsvar", "~m~Benutzung:~s~ /setsvar [ID] [WERT]")]
|
||||
public void CmdAdmSetSvar(Player player, int varId, int varValue)
|
||||
{
|
||||
|
||||
@@ -81,9 +81,10 @@ namespace ReallifeGamemode.Server.Factions.Medic
|
||||
{
|
||||
if (task.MedicName != null)
|
||||
{
|
||||
var taskTimeLeft = (Int32)(((DateTimeOffset)task.Time).ToUnixTimeSeconds() - ((DateTimeOffset)actualTime).ToUnixTimeSeconds() - reviveTaskTime);
|
||||
var taskTimeLeft = Math.Abs((Int32)(((DateTimeOffset)actualTime).ToUnixTimeSeconds() - ((DateTimeOffset)task.Time).ToUnixTimeSeconds() - reviveTaskTime));
|
||||
task.TimeLeft = taskTimeLeft;
|
||||
PlayerService.GetPlayerByNameOrId(task.MedicName).TriggerEvent("setTaskTimeLeft", taskTimeLeft);
|
||||
var medic = PlayerService.GetPlayerByNameOrId(task.MedicName);
|
||||
if(task.MedicName != "none") medic.TriggerEvent("setTaskTimeLeft", taskTimeLeft);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,9 @@ namespace ReallifeGamemode.Server.Util
|
||||
timer500.Start();
|
||||
timer500.Elapsed += Timer500_Elapsed;
|
||||
|
||||
timer1000.Start();
|
||||
timer1000.Elapsed += Timer1000_Elapsed;
|
||||
|
||||
timer2500.Start();
|
||||
timer2500.Elapsed += Timer2500_Elapsed;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user