Merge branch 'develop' of ssh://development.life-of-german.org:451/log-gtav/reallife-gamemode into develop
This commit is contained in:
@@ -234,18 +234,19 @@ namespace ReallifeGamemode.Server.Commands
|
||||
[Command("setweaponrank", "~m~Benutzung: ~s~/setweaponrank [Waffen Name] [Rank]")]
|
||||
public void CmdFactionWeaponRank(Player player, string weaponModel, int rank)
|
||||
{
|
||||
if (player.GetUser()?.FactionId == null || player.GetUser().FactionLeader == false)
|
||||
User user = player.GetUser();
|
||||
if (user == null || user.FactionId == null || user.FactionLeader == false)
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
}
|
||||
|
||||
if (rank > 12 || rank < 1)
|
||||
{
|
||||
ChatService.ErrorMessage(player, "Gebe einen gültigen Rang ein");
|
||||
return;
|
||||
}
|
||||
|
||||
User user = player.GetUser();
|
||||
WeaponPoint nearestWeapon = PositionManager.WeaponPoints.Find(w => w.Position.DistanceTo(player.Position) <= 1.5 && w.FactionId == user.FactionId);
|
||||
if (nearestWeapon == null)
|
||||
{
|
||||
|
||||
@@ -13,5 +13,15 @@ namespace ReallifeGamemode.Server.Events
|
||||
{
|
||||
player.SafeTeleport(pos);
|
||||
}
|
||||
|
||||
[RemoteEvent("CLIENT:SetAfkStatus")]
|
||||
public void SetPlayerAfkStatus(Player player, bool status)
|
||||
{
|
||||
player.SetServerData("isAfk", status);
|
||||
if(status)
|
||||
{
|
||||
player.SendNotification("Du wurdest ~b~AFK~s~ gesetzt", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace ReallifeGamemode.Server.Extensions
|
||||
return;
|
||||
}
|
||||
|
||||
int time = 26 * user.Wanteds;
|
||||
int time = 18 * user.Wanteds;
|
||||
if (killed)
|
||||
{
|
||||
time *= 2;
|
||||
@@ -136,6 +136,11 @@ namespace ReallifeGamemode.Server.Extensions
|
||||
return player.GetServerData("duty", false);
|
||||
}
|
||||
|
||||
public static bool IsAfk(this Player player)
|
||||
{
|
||||
return player.GetServerData("isAfk", false);
|
||||
}
|
||||
|
||||
public static bool IsAlive(this Player player)
|
||||
{
|
||||
return !player.HasData("isDead") || player.GetData<bool>("isDead") == false;
|
||||
|
||||
@@ -189,6 +189,11 @@ namespace ReallifeGamemode.Server.Finance
|
||||
using var dbContext = new DatabaseContext();
|
||||
foreach (var player in NAPI.Pools.GetAllPlayers().Where(p => p.IsLoggedIn()))
|
||||
{
|
||||
if(player.IsAfk())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
User user = player.GetUser(dbContext);
|
||||
if(user == null)
|
||||
{
|
||||
|
||||
@@ -247,7 +247,7 @@ namespace ReallifeGamemode.Server.Gangwar
|
||||
Player[] attackers = NAPI.Pools.GetAllPlayers().Where(c => c.IsLoggedIn() && c.GetUser().Faction?.Name == this.Attacker).ToArray();
|
||||
|
||||
Faction ownerFaction = dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Name == getOwner()).FirstOrDefault();
|
||||
Faction attackerFaction = dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Name == getOwner()).FirstOrDefault();
|
||||
Faction attackerFaction = dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Name == getAttacker()).FirstOrDefault();
|
||||
|
||||
if (ownerFaction == null || attackerFaction == null)
|
||||
{
|
||||
|
||||
@@ -564,6 +564,11 @@ namespace ReallifeGamemode.Server.Job
|
||||
return;
|
||||
}
|
||||
|
||||
if(!playerVehiclePair.ContainsKey(player))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (JobManager.playerTimersJobVehicleRespawn.ContainsKey(player))
|
||||
{
|
||||
JobManager.playerTimersJobVehicleRespawn[player].Stop();
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace ReallifeGamemode.Server.Managers
|
||||
|
||||
FactionHelper.ResetPlayer(player, own, dbContext);
|
||||
|
||||
own.Faction = u.Faction;
|
||||
own.FactionId = u.FactionId;
|
||||
own.FactionLeader = false;
|
||||
own.FactionRank = dbContext
|
||||
.FactionRanks
|
||||
|
||||
@@ -754,6 +754,19 @@ namespace ReallifeGamemode.Server.Managers
|
||||
"winky",
|
||||
"polamggtr", //mod
|
||||
"newsfrog", //mod
|
||||
"fibn",//mod
|
||||
"fibg",//mod
|
||||
"fibd",//mod
|
||||
"fibs",//mod
|
||||
"fibc",//mod
|
||||
"fibn2",//mod
|
||||
"fibx",//mod
|
||||
"fibg2",//mod
|
||||
"fibd2",//mod
|
||||
"fibj",//mod
|
||||
"fibn3",//mod
|
||||
"fibr"//mod
|
||||
|
||||
};
|
||||
|
||||
private static readonly Dictionary<int, NetHandle> _serverVehicles = new Dictionary<int, NetHandle>();
|
||||
|
||||
@@ -30,6 +30,11 @@ namespace ReallifeGamemode.Server.WeaponDeal
|
||||
public void SrvEVENT_startWeaponDeal(Player client)
|
||||
{
|
||||
var user = client.GetUser();
|
||||
if(user == null || user.FactionId == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
using (var context = new DatabaseContext(true))
|
||||
{
|
||||
FactionVehicle factionVehicle = context.FactionVehicles.Where(f => f.Model == VehicleHash.Burrito3 || f.Model == VehicleHash.Policet).ToList().Where(f => f.GetOwners().Contains(user.FactionId ?? 0)).FirstOrDefault();
|
||||
@@ -40,7 +45,6 @@ namespace ReallifeGamemode.Server.WeaponDeal
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Vehicle fVeh = VehicleManager.GetVehicleFromServerVehicle(factionVehicle);
|
||||
|
||||
if (checkWeaponDbyVehicle(fVeh))
|
||||
@@ -58,7 +62,7 @@ namespace ReallifeGamemode.Server.WeaponDeal
|
||||
|
||||
WeaponDealPoints.factionWeaponDeal[user.FactionId.Value] = -1;
|
||||
Vector3 vector;
|
||||
vector = WeaponDealPoints.getRndWD_Route(client.GetUser().FactionId.Value);
|
||||
vector = WeaponDealPoints.getRndWD_Route(user.FactionId.Value);
|
||||
if (vector == new Vector3())
|
||||
return;
|
||||
fVeh.SetData<Vector3>("weaponDealPoint", vector);
|
||||
|
||||
Reference in New Issue
Block a user