Maybe finished taxi job

This commit is contained in:
hydrant
2019-05-21 21:35:49 +02:00
parent 425ea3e143
commit 7d0de9c662
10 changed files with 897 additions and 210 deletions

View File

@@ -13,8 +13,8 @@ namespace ReallifeGamemode.Server.Job
{
public abstract class JobBase
{
public delegate void JobStartHandler();
public delegate void JobStopHandler();
public delegate void JobStartHandler(Client player);
public delegate void JobStopHandler(Client player);
public event JobStartHandler JobStart;
public event JobStopHandler JobStop;
@@ -33,7 +33,7 @@ namespace ReallifeGamemode.Server.Job
player.SendChatMessage($"~y~[JOB]~s~ Du hast deinen Job ~o~{this.Name}~s~ gestartet.");
JobStart?.Invoke();
JobStart?.Invoke(player);
}
public void StopJob(Client player)
@@ -42,7 +42,7 @@ namespace ReallifeGamemode.Server.Job
player.SendChatMessage($"~y~[JOB]~s~ Du hast deinen Job ~o~{this.Name}~s~ beendet.");
JobStop?.Invoke();
JobStop?.Invoke(player);
}
public List<JobVehicle> GetJobVehicles()

View File

@@ -2,15 +2,34 @@
using System.Collections.Generic;
using System.Text;
using GTANetworkAPI;
using ReallifeGamemode.Server.Util;
namespace ReallifeGamemode.Server.Job
{
class TaxiDriverJob : JobBase
{
public List<TaxiContract> TaxiContracts { get; set; } = new List<TaxiContract>();
public override int Id => 1;
public override string Name => "Taxifahrer";
public override bool NeedVehicleToStart => true;
public TaxiDriverJob()
{
JobStart += TaxiDriverJobJobStart;
JobStop += TaxiDriverJobJobStop;
}
private void TaxiDriverJobJobStart(Client player)
{
player.Vehicle.SetSharedData("vehicleTaxiLight", true);
}
private void TaxiDriverJobJobStop(Client player)
{
player.Vehicle.SetSharedData("vehicleTaxiLight", false);
}
}
}