Files
reallife-gamemode/ReallifeGamemode.Server/Wanted/Autowanted.cs
Siga edf06f4478 RAGE Multiplayer 1.1.0-DP Update
/freeze was obselete and removed
/unfreeze was obselete and removed
/spectate was obselete and removed
2020-02-24 21:19:23 +01:00

33 lines
834 B
C#

using System;
using System.Collections.Generic;
using System.Text;
using GTANetworkAPI;
using ReallifeGamemode.Database.Entities;
using ReallifeGamemode.Database.Models;
using ReallifeGamemode.Server.Extensions;
namespace ReallifeGamemode.Server.Wanted
{
public class Autowanted
{
public static void Check_AutoWanted(Player killerPlayer, Player copPlayer)
{
User killer = killerPlayer.GetUser();
if (killer.FactionId == 1 || killer.FactionId == 3)
return;
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();
}
}
}
}
}