look basis
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using GTANetworkAPI;
|
||||
using Newtonsoft.Json;
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
using ReallifeGamemode.Database.Models;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
@@ -16,6 +17,21 @@ namespace ReallifeGamemode.Server.Commands
|
||||
{
|
||||
internal class UserCommands : Script
|
||||
{
|
||||
[Command("look", "~m~look")]
|
||||
public void CmdUserLook(Player player)
|
||||
{
|
||||
if (!player.IsLoggedIn()) return;
|
||||
|
||||
Vehicle veh = NAPI.Pools.GetAllVehicles().Where(v => v.Position.DistanceTo(player.Position) <= 5).FirstOrDefault();
|
||||
|
||||
if (veh == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
player.TriggerEvent("lookLastDrivers", JsonConvert.SerializeObject(VehicleManager.lastDriversInVehicle[veh]));
|
||||
}
|
||||
|
||||
[Command("id", "~m~Benutzung: ~s~/id [Name]")]
|
||||
public void CmdUserId(Player player, String targetname)
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using GTANetworkAPI;
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
using ReallifeGamemode.Server.Managers;
|
||||
using ReallifeGamemode.Server.Util;
|
||||
using ReallifeGamemode.Server.WeaponDeal;
|
||||
|
||||
@@ -20,6 +21,13 @@ namespace ReallifeGamemode.Server.Events
|
||||
if (vehicle.HasMarkerBehind())
|
||||
vehicle.RemoveMarkerBehind();
|
||||
|
||||
if (!VehicleManager.lastDriversInVehicle.ContainsKey(vehicle))
|
||||
{
|
||||
VehicleManager.lastDriversInVehicle.Add(vehicle, new List<string>());
|
||||
}
|
||||
|
||||
VehicleManager.lastDriversInVehicle[vehicle].Add(client.Name);
|
||||
|
||||
if (vehicle.GetServerVehicle() is FactionVehicle veh)
|
||||
{
|
||||
User u = client.GetUser();
|
||||
|
||||
@@ -18,6 +18,9 @@ namespace ReallifeGamemode.Server.Managers
|
||||
{
|
||||
public class VehicleManager : Script
|
||||
{
|
||||
|
||||
public static Dictionary<Vehicle, List<String>> lastDriversInVehicle = new Dictionary<Vehicle, List<string>>();
|
||||
|
||||
private static readonly List<string> _enabledMods = new List<string>()
|
||||
{
|
||||
"ninef",
|
||||
|
||||
Reference in New Issue
Block a user