72 lines
2.0 KiB
C#
72 lines
2.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using GTANetworkAPI;
|
|
using ReallifeGamemode.Server.Util;
|
|
using Newtonsoft.Json;
|
|
using GTANetworkAPI;
|
|
using ReallifeGamemode.Server.Services;
|
|
|
|
namespace ReallifeGamemode.Server.Job
|
|
{
|
|
class BusDriverJob : JobBase
|
|
{
|
|
public override int Id => 4;
|
|
|
|
public override string Name => "Busfahrer";
|
|
|
|
public override bool NeedVehicleToStart => true;
|
|
|
|
public String routeText;
|
|
|
|
private readonly IReadOnlyCollection<Vector3> Route1 = new List<Vector3>
|
|
{
|
|
new Vector3(-105.5951, -1684.548, 29.23948),
|
|
new Vector3(-1056.246, -2552.576, 13.66063),
|
|
new Vector3(200.3088, -1978.828, 19.3329),
|
|
new Vector3(358.6138, -1785.821, 28.92113),
|
|
new Vector3(281.8594, -1462.503, 29.13148),
|
|
new Vector3(77.72239, -1212.086, 29.12294),
|
|
new Vector3(218.1398, -850.9549, 30.16619)
|
|
}.AsReadOnly();
|
|
|
|
private readonly IReadOnlyCollection<Vector3> Route2 = new List<Vector3>
|
|
{
|
|
new Vector3(403.4488, -786.5514, 29.2046),
|
|
new Vector3(787.6898, -1364.566, 26.41318),
|
|
new Vector3(942.0541, -1447.974, 31.14204),
|
|
new Vector3(866.8322, -997.5225, 30.48207),
|
|
new Vector3(785.4254, -781.3905, 26.33277),
|
|
new Vector3(351.5793, -1064.582, 29.40059),
|
|
new Vector3(235.0964, -857.1152, 29.74256),
|
|
}.AsReadOnly();
|
|
|
|
public BusDriverJob()
|
|
{
|
|
JobStart += BusDriverJob_JobStart;
|
|
}
|
|
|
|
private void BusDriverJob_JobStart(Client player)
|
|
{
|
|
List<String> listRouteTexts = new List<string>();
|
|
listRouteTexts.Add("Kurz 1");
|
|
listRouteTexts.Add("Kurz 2");
|
|
|
|
player.TriggerEvent("showBusRouteMenu", JsonConvert.SerializeObject(listRouteTexts));
|
|
}
|
|
|
|
[RemoteEvent("startBusRoute")]
|
|
public void StartBusRoute(Client player, string type)
|
|
{
|
|
if (type == "Kurz 1")
|
|
{
|
|
CheckPointHandle.StartCheckPointRoute(player, Route1, 3000, 1);
|
|
} else if (type == "Kurz 2")
|
|
{
|
|
CheckPointHandle.StartCheckPointRoute(player, Route2, 3000, 1);
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|