RAGE Multiplayer 1.1.0-DP Update

/freeze was obselete and removed
/unfreeze was obselete and removed
/spectate was obselete and removed
This commit is contained in:
Siga
2020-02-24 21:18:54 +01:00
parent 0d5731fb11
commit edf06f4478
85 changed files with 804 additions and 643 deletions

View File

@@ -17,7 +17,7 @@ namespace ReallifeGamemode.Server.Wanted
private static Dictionary<int, int> Jailtime { get; set; } = new Dictionary<int, int>(); //time in seconds
public static void Check_PutBehindBars(Client client)
public static void Check_PutBehindBars(Player client)
{
User user = client.GetUser();
if (user.JailTime > 0)
@@ -38,17 +38,18 @@ namespace ReallifeGamemode.Server.Wanted
}
if (user.Wanteds <= 0)
return;
foreach (var copClient in NAPI.Pools.GetAllPlayers())
foreach (var copPlayer in NAPI.Pools.GetAllPlayers())
{
User cop = copClient.GetUser();
if (!copPlayer.IsLoggedIn()) continue;
User cop = copPlayer.GetUser();
if (cop?.FactionId == 1 || cop?.FactionId == 3)
{
int jailTime = user.Wanteds * 54;
if (cop.GetData<bool>("duty") && copClient.Position.DistanceTo2D(client.Position) <= 200 && (!copClient.HasData("isDead") || copClient.GetData("isDead") != true))
if (cop.GetData<bool>("duty") && copPlayer.Position.DistanceTo2D(client.Position) <= 200 && (!copPlayer.HasData("isDead") || copPlayer.GetData<bool>("isDead") != true))
{
using (var dbContext = new DatabaseContext())
{
if (!client.HasData("isDead") || client.GetData("isDead") == false)
if (!client.HasData("isDead") || client.GetData<bool>("isDead") == false)
{
jailTime /= 2;
}
@@ -135,8 +136,9 @@ namespace ReallifeGamemode.Server.Wanted
{
foreach (var copPlayer in NAPI.Pools.GetAllPlayers())
{
if (!copPlayer.IsLoggedIn()) return;
User cop = copPlayer.GetUser();
if (cop.GetData<bool>("duty") && copPlayer.Position.DistanceTo2D(player.Position) <= 500 && (!copPlayer.HasData("isDead") || copPlayer.GetData("isDead") != true))
if (cop.GetData<bool>("duty") && copPlayer.Position.DistanceTo2D(player.Position) <= 500 && (!copPlayer.HasData("isDead") || copPlayer.GetData<bool>("isDead") != true))
{
if (player.Position.DistanceTo2D(new Vector3(458.9842, -997.2126, 24.91485)) <= 7)
{
@@ -218,9 +220,9 @@ namespace ReallifeGamemode.Server.Wanted
}
[RemoteEvent("setPrisonerFree")]
public void Release_Jail(Client cop, string client)
public void Release_Jail(Player cop, string client)
{
Client player = ClientService.GetClientByNameOrId(client);
Player player = PlayerService.GetPlayerByNameOrId(client);
if (player == null)
return;
@@ -243,7 +245,7 @@ namespace ReallifeGamemode.Server.Wanted
}
}
public static void Release_Jail_Admin(Client admin, Client target)
public static void Release_Jail_Admin(Player admin, Player target)
{
User user = target.GetUser();
if (Jailtime.ContainsKey(user.Id))