Fix Count Duty Medics

This commit is contained in:
VegaZ
2021-02-05 20:29:06 +01:00
parent 3f59982855
commit 466ab4cc63
6 changed files with 23 additions and 29 deletions

View File

@@ -274,15 +274,7 @@ namespace ReallifeGamemode.Server.Events
player.TriggerEvent("toggleDutyMode", true);
if (player.GetUser().FactionId == 2) //Fire Department
{
int medicCount = 0;
foreach (Player c in NAPI.Pools.GetAllPlayers())
{
if ((c.GetUser()?.Faction?.Id ?? 0) == 2)
{
medicCount++;
}
}
NAPI.ClientEvent.TriggerClientEventForAll("updateDutyMedics", medicCount);
Medic.UpdateDutyMedics(1);
}
switch (factionId)
{
@@ -334,7 +326,7 @@ namespace ReallifeGamemode.Server.Events
user.SetData("duty", false);
player.SendNotification("Du bist nun ~r~außer Dienst.");
player.TriggerEvent("toggleDutyMode", false);
NAPI.ClientEvent.TriggerClientEventForAll("updateDutyMedics", false);
Medic.UpdateDutyMedics(-1);
player.SetSharedData("blipColor", 0);
UpdateCharacterCloth.LoadCharacterDefaults(player);
}