admin unjail
This commit is contained in:
@@ -174,8 +174,6 @@ namespace ReallifeGamemode.Server.Wanted
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
[RemoteEvent("setPrisonerFree")]
|
||||
public void Release_Jail(Client cop, string client)
|
||||
{
|
||||
@@ -206,6 +204,31 @@ namespace ReallifeGamemode.Server.Wanted
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void Release_Jail_Admin(Client admin, Client target)
|
||||
{
|
||||
User user = target.GetUser();
|
||||
if (Jailtime.ContainsKey(user.Id))
|
||||
{
|
||||
|
||||
Jailtime.Remove(user.Id);
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
target.GetUser(dbContext).JailTime = 0;
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
target.Health = 100;
|
||||
target.Position = new Vector3(461.7256, -988.6035, 24.91487);
|
||||
foreach (var copPlayer in NAPI.Pools.GetAllPlayers())
|
||||
{
|
||||
User copUser = copPlayer.GetUser();
|
||||
if ((copUser.FactionId == 1 || copUser.FactionId == 3))
|
||||
{
|
||||
ChatService.SendMessage(copPlayer, "!{#8181E9}HQ: Admin " + admin.Name + " hat " + user.Name + " aus dem Knast entlassen.");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user