Fix Count Duty Medics
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user