[+] New Feature in Wanted System
+ Autowanted System (only cop murder) * Fix: rejail after breakout * Fix: typo in /wa Command
This commit is contained in:
@@ -211,7 +211,7 @@ namespace ReallifeGamemode.Server.Commands
|
||||
User targetCop = target.GetUser();
|
||||
if(targetCop.FactionId == 1 || targetCop.FactionId == 2)
|
||||
{
|
||||
ChatService.ErrorMessage(player, "Du kannst dieser Person keine Wanteds geben.");
|
||||
ChatService.ErrorMessage(player, "Du kannst dieser Person keine Wanteds geben");
|
||||
return;
|
||||
}
|
||||
User targetUser = target.GetUser();
|
||||
|
||||
@@ -70,6 +70,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
killerHeading = killer.Heading;
|
||||
if (player != killer)
|
||||
{
|
||||
Autowanted.Check_AutoWanted(killer, player);
|
||||
string message = "~y~[HINWEIS]: " + killer.Name + " hat " + player.Name + " getötet (" + NAPI.Player.GetPlayerCurrentWeapon(killer) + ")";
|
||||
ChatService.BroadcastAdmin(message, AdminLevel.ADMIN);
|
||||
}
|
||||
|
||||
31
ReallifeGamemode.Server/Wanted/Autowanted.cs
Normal file
31
ReallifeGamemode.Server/Wanted/Autowanted.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using GTANetworkAPI;
|
||||
using ReallifeGamemode.Server.Entities;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
using ReallifeGamemode.Server.Models;
|
||||
|
||||
namespace ReallifeGamemode.Server.Wanted
|
||||
{
|
||||
public class Autowanted
|
||||
{
|
||||
public static void Check_AutoWanted(Client killerPlayer, Client copPlayer)
|
||||
{
|
||||
User killer = killerPlayer.GetUser();
|
||||
if(killer.FactionId != 1 || killer.FactionId != 3)
|
||||
{
|
||||
User cop = copPlayer.GetUser();
|
||||
if(cop.FactionId == 1 || cop.FactionId == 3)
|
||||
{
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
killer = killerPlayer.GetUser(dbContext);
|
||||
killer.GiveWanteds(copPlayer, 10, "Beamten-Mord");
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -112,8 +112,9 @@ namespace ReallifeGamemode.Server.Wanted
|
||||
if (player.Position.DistanceTo2D(new Vector3(458.9842, -997.2126, 24.91485)) > 7 && Jailtime.ContainsKey(user.Id))
|
||||
{
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
{
|
||||
user = player.GetUser(dbContext);
|
||||
user.JailTime = 0;
|
||||
user.GiveWanteds(null, 50, "Knast-Ausbruch");
|
||||
dbContext.SaveChanges();
|
||||
Jailtime.Remove(user.Id);
|
||||
|
||||
Reference in New Issue
Block a user