look basis

This commit is contained in:
Fabian
2021-04-13 21:34:14 +02:00
parent f6b4dd481a
commit 18e385717b
10 changed files with 281 additions and 0 deletions

View File

@@ -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)
{