add option to call taxi service in interaction menu (key down)

This commit is contained in:
hydrant
2019-05-20 22:38:19 +02:00
parent 9dda9b195d
commit 6edf9ebd0b
7 changed files with 67 additions and 2 deletions

View File

@@ -93,7 +93,7 @@ namespace ReallifeGamemode.Server.Commands
}
using (var getFaction = new DatabaseContext())
{
Entities.Faction receiverUser = getFaction.Factions.FirstOrDefault(u => u.Name == receiver);
Faction receiverUser = getFaction.Factions.FirstOrDefault(u => u.Name == receiver);
if (receiverUser == null)
{

View File

@@ -111,7 +111,8 @@ namespace ReallifeGamemode.Server.Events
faction = u.Faction?.Name ?? "Zivilist",
factionRank = u.GetFactionRank().RankName,
group = u.Group?.Name ?? "Keine",
groupRank = u.GroupRank.GetName()
groupRank = u.GroupRank.GetName(),
job = JobManager.GetJob(u.JobId ?? 0)?.Name ?? "Keiner"
};
string faction = u.FactionLeader ? u.Faction.Name : null;

View File

@@ -2,6 +2,7 @@
using Newtonsoft.Json;
using ReallifeGamemode.Server.Entities;
using ReallifeGamemode.Server.Extensions;
using ReallifeGamemode.Server.Job;
using ReallifeGamemode.Server.Models;
using ReallifeGamemode.Server.Services;
using ReallifeGamemode.Server.Util;
@@ -246,6 +247,13 @@ namespace ReallifeGamemode.Server.Managers
}
}
}
[RemoteEvent("CLIENT:InteractionMenu_CallService_Taxi")]
public void CallServiceTaxi(Client player, string street, string zone)
{
string msg = $"!{{02FCFF}}{player.Name} hat in der {street} in {zone} ein Taxi gerufen.";
ChatService.BroadcastJob(msg, JobManager.GetJob<TaxiDriverJob>());
}
#endregion
#region Spielerinteraktionen PFEILTASTE-LINKS
[RemoteEvent("openTradeInventory")]

View File

@@ -1,6 +1,7 @@
using GTANetworkAPI;
using ReallifeGamemode.Server.Entities;
using ReallifeGamemode.Server.Extensions;
using ReallifeGamemode.Server.Job;
using ReallifeGamemode.Server.Util;
using System.Collections.Generic;
@@ -88,5 +89,10 @@ namespace ReallifeGamemode.Server.Services
}
});
}
public static void BroadcastJob(string message, JobBase job)
{
job.GetUsersInJob().ForEach(c => c.SendChatMessage(message));
}
}
}