From e4d35d2da47b12993968f2108215afe2d245c749 Mon Sep 17 00:00:00 2001 From: hydrant Date: Mon, 30 Sep 2019 21:15:42 +0200 Subject: [PATCH] head --- .../Commands/AdminCommands.cs | 4 +- .../Job/BusDriver/Commands.cs | 120 ------------------ .../Job/BusDriver/Events.cs | 22 ---- .../Job/BusDriver/JobBlips.cs | 40 ------ .../Job/BusDriver/JobInfoCheckPoints.cs | 58 --------- .../Job/BusDriver/ObjectiveInfo.cs | 18 --- 6 files changed, 2 insertions(+), 260 deletions(-) delete mode 100644 ReallifeGamemode.Server/Job/BusDriver/Commands.cs delete mode 100644 ReallifeGamemode.Server/Job/BusDriver/Events.cs delete mode 100644 ReallifeGamemode.Server/Job/BusDriver/JobBlips.cs delete mode 100644 ReallifeGamemode.Server/Job/BusDriver/JobInfoCheckPoints.cs delete mode 100644 ReallifeGamemode.Server/Job/BusDriver/ObjectiveInfo.cs diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index 8310ef28..56e087f4 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -224,7 +224,7 @@ namespace ReallifeGamemode.Server.Commands } [Command("position", "~m~Benutzung: ~s~/position")] - public void CmdAdminShowPos(Client player) + public void CmdAdminPosition(Client player) { if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true) { @@ -232,7 +232,7 @@ namespace ReallifeGamemode.Server.Commands return; } - ChatService.SendMessage(player, "Position: X Y Z H: " + player.Position); + ChatService.SendMessage(player, "Position: X Y Z H: " + player.Position + " " + player.Heading); } [Command("gh", "~m~Benutzung: ~s~/gh [Name]")] diff --git a/ReallifeGamemode.Server/Job/BusDriver/Commands.cs b/ReallifeGamemode.Server/Job/BusDriver/Commands.cs deleted file mode 100644 index a830f958..00000000 --- a/ReallifeGamemode.Server/Job/BusDriver/Commands.cs +++ /dev/null @@ -1,120 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using GTANetworkAPI; - -namespace ReallifeGamemode.Server.Job.BusDriver -{ - public class Commands : Script - { - public static List NewPositions = new List(); - - [Command("job", "~r~Verwende: ~w~ /job [JobName]")] - public void CMD_Job(Client player, string JobName) - { - if (player.HasData("BusJob")) - { - NAPI.Notification.SendNotificationToPlayer(player, "Du hast schon einen Job!"); - } - if (!player.HasData("BusJob") && (JobName == "Busfahrer")) - { - player.SetData("BusJob", true); - NAPI.Notification.SendNotificationToPlayer(player, "Du hast den Job Busfahrer angenommen"); - } - } - - [Command("jobs")] - public void CMD_Jobs(Client player) - { - NAPI.Chat.SendChatMessageToPlayer(player, "Jobs: Busfahrer"); - } - - [Command("quitjob")] - public void CMD_QuitJob(Client player) - { - player.ResetData("BusJob"); - NAPI.Notification.SendNotificationToPlayer(player, "Du hast deinen Job gekündigt"); - } - - [Command("stopjob")] - public void CMD_StopJob(Client player) - { - if (!player.HasData("BusJobAn")) // Wenn Spieler keinen Job angefangen hat - { - NAPI.Notification.SendNotificationToPlayer(player, "Du hast keinen Job begonnen"); - return; - } - else if (player.HasData("BusJobAn")) // Wenn Spieler Job angefangen hat - { - NAPI.Notification.SendNotificationToPlayer(player, "Du hast deinen Job beendet. Deinen Lohn erhälst du am Payday."); - player.ResetData("BusJobAn"); - player.TriggerEvent("clear_all_blips"); - } - } - - [Command("startjob")] - public void CMD_AddPosition(Client client, string route, float size) - { - if (route == "1" && client.HasData("BusJob")) - { - NAPI.Notification.SendNotificationToPlayer(client, "Du hast die Route 1 ausgewählt, fahre jetzt die Haltestellen ab."); - client.SetData("BusJobAn", true); - NewPositions.Add(new Vector3(308.0671, -762.0952, 29.21954)); - NewPositions.Add(new Vector3(-105.5951, -1684.548, 29.23948)); - NewPositions.Add(new Vector3(-1056.246, -2552.576, 13.66063)); - NewPositions.Add(new Vector3(200.3088, -1978.828, 19.3329)); - NewPositions.Add(new Vector3(358.6138, -1785.821, 28.92113)); - NewPositions.Add(new Vector3(281.8594, -1462.503, 29.13148)); - NewPositions.Add(new Vector3(77.72239, -1212.086, 29.12294)); - NewPositions.Add(new Vector3(218.1398, -850.9549, 30.16619)); - JobInfo jobInfo = new JobInfo(); - foreach (Vector3 vector in NewPositions) - { - jobInfo.AddObjective(vector, size); - } - jobInfo.StartJob(client); - NewPositions = new List(); - } - else if (route == "2" && client.HasData("BusJob")) - { - NAPI.Notification.SendNotificationToPlayer(client, "Du hast die Route 2 ausgewählt, fahre jetzt die Haltestellen ab."); - client.SetData("BusJobAn", true); - NewPositions.Add(new Vector3(403.4488, -786.5514, 29.2046)); - NewPositions.Add(new Vector3(351.5793, -1064.582, 29.40059)); - NewPositions.Add(new Vector3(787.6898, -1364.566, 26.41318)); - NewPositions.Add(new Vector3(942.0541, -1447.974, 31.14204)); - NewPositions.Add(new Vector3(866.8322, -997.5225, 30.48207)); - NewPositions.Add(new Vector3(785.4254, -781.3905, 26.33277)); - NewPositions.Add(new Vector3(235.0964, -857.1152, 29.74256)); - JobInfo jobInfo = new JobInfo(); - foreach (Vector3 vector in NewPositions) - { - jobInfo.AddObjective(vector, size); - } - jobInfo.StartJob(client); - NewPositions = new List(); - } - /*else if (route == "3" && client.HasData("BusJob")) // Platzhalter für weitere Routen - { - NAPI.Notification.SendNotificationToPlayer(client, "Du hast die Route 3 ausgewählt, fahre jetzt die Haltestellen ab."); - client.SetData("BusJobAn", true); - NewPositions.Add(new Vector3(306.163, -767.4735, 29.20587)); - NewPositions.Add(new Vector3(76.55303, -1468.593, 29.23081)); - NewPositions.Add(new Vector3(-105.5951, -1684.548, 29.23948)); - NewPositions.Add(new Vector3(-1056.246, -2552.576, 13.66063)); - NewPositions.Add(new Vector3(200.3088, -1978.828, 19.3329)); - NewPositions.Add(new Vector3(358.6138, -1785.821, 28.92113)); - NewPositions.Add(new Vector3(281.8594, -1462.503, 29.13148)); - NewPositions.Add(new Vector3(77.72239, -1212.086, 29.12294)); - NewPositions.Add(new Vector3(218.1398, -850.9549, 30.16619)); - JobInfo jobInfo = new JobInfo(); - foreach (Vector3 vector in NewPositions) - { - jobInfo.AddObjective(vector, size); - } - jobInfo.StartJob(client); - NewPositions = new List(); - }*/ - } - } -} diff --git a/ReallifeGamemode.Server/Job/BusDriver/Events.cs b/ReallifeGamemode.Server/Job/BusDriver/Events.cs deleted file mode 100644 index 16666103..00000000 --- a/ReallifeGamemode.Server/Job/BusDriver/Events.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using GTANetworkAPI; - -namespace ReallifeGamemode.Server.Job.BusDriver -{ - public class Events : Script - { - // Client Events - - [RemoteEvent("marker_completed")] - public void RemoteEvent_MarkerCompleted(Client client) - { - if (!client.HasData("Job")) - return; - - JobInfo jobInfo = client.GetData("Job"); - jobInfo.CheckObjective(client); - } - } -} diff --git a/ReallifeGamemode.Server/Job/BusDriver/JobBlips.cs b/ReallifeGamemode.Server/Job/BusDriver/JobBlips.cs deleted file mode 100644 index 6e2255ba..00000000 --- a/ReallifeGamemode.Server/Job/BusDriver/JobBlips.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using GTANetworkAPI; - -namespace ReallifeGamemode.Server.Job.BusDriver -{ - public class JobBlips : Script - { - // Route 1 - Blip Blip = NAPI.Blip.CreateBlip(513, new Vector3(308.0671, -762.0952, 29.21954), 1, 4, "Haltestelle(R1)", 255, 0, true); - Blip Blip2 = NAPI.Blip.CreateBlip(513, new Vector3(-105.5951, -1684.548, 29.23948), 1, 4, "Haltestelle(R1)", 255, 0, true); - Blip Blip3 = NAPI.Blip.CreateBlip(513, new Vector3(-1056.246, -2552.576, 13.66063), 1, 4, "Haltestelle(R1)", 255, 0, true); - Blip Blip4 = NAPI.Blip.CreateBlip(513, new Vector3(200.3088, -1978.828, 19.3329), 1, 4, "Haltestelle(R1)", 255, 0, true); - Blip Blip5 = NAPI.Blip.CreateBlip(513, new Vector3(358.6138, -1785.821, 28.92113), 1, 4, "Haltestelle(R1)", 255, 0, true); - Blip Blip6 = NAPI.Blip.CreateBlip(513, new Vector3(281.8594, -1462.503, 29.13148), 1, 4, "Haltestelle(R1)", 255, 0, true); - Blip Blip7 = NAPI.Blip.CreateBlip(513, new Vector3(77.72239, -1212.086, 29.12294), 1, 4, "Haltestelle(R1)", 255, 0, true); - Blip Blip8 = NAPI.Blip.CreateBlip(513, new Vector3(218.1398, -850.9549, 30.16619), 1, 4, "Haltestelle(R1)", 255, 0, true); - - //Route 2 - Blip Blip9 = NAPI.Blip.CreateBlip(513, new Vector3(403.4488, -786.5514, 29.2046), 1, 27, "Haltestelle(R2)", 255, 0, true); - Blip Blip11 = NAPI.Blip.CreateBlip(513, new Vector3(787.6898, -1364.566, 26.41318), 1, 27, "Haltestelle(R2)", 255, 0, true); - Blip Blip12 = NAPI.Blip.CreateBlip(513, new Vector3(942.0541, -1447.974, 31.14204), 1, 27, "Haltestelle(R2)", 255, 0, true); - Blip Blip13 = NAPI.Blip.CreateBlip(513, new Vector3(866.8322, -997.5225, 30.48207), 1, 27, "Haltestelle(R2)", 255, 0, true); - Blip Blip14 = NAPI.Blip.CreateBlip(513, new Vector3(785.4254, -781.3905, 26.33277), 1, 27, "Haltestelle(R2)", 255, 0, true); - Blip Blip15 = NAPI.Blip.CreateBlip(513, new Vector3(351.5793, -1064.582, 29.40059), 1, 27, "Haltestelle(R2)", 255, 0, true); - Blip Blip16 = NAPI.Blip.CreateBlip(513, new Vector3(235.0964, -857.1152, 29.74256), 1, 27, "Haltestelle(R2)", 255, 0, true); - - // Route 3 // Platzhalter weitere Blips Routen - /*Blip Blip17 = NAPI.Blip.CreateBlip(513, new Vector3(306.163, -767.4735, 29.20587), 1, 49, "Haltestelle(R3)", 255, 0, true); - Blip Blip18 = NAPI.Blip.CreateBlip(513, new Vector3(76.55303, -1468.593, 29.23081), 1, 49, "Haltestelle(R3)", 255, 0, true); - Blip Blip19 = NAPI.Blip.CreateBlip(513, new Vector3(-105.5951, -1684.548, 29.23948), 1, 49, "Haltestelle(R3)", 255, 0, true); - Blip Blip20 = NAPI.Blip.CreateBlip(513, new Vector3(-1056.246, -2552.576, 13.66063), 1, 49, "Haltestelle(R3)", 255, 0, true); - Blip Blip21 = NAPI.Blip.CreateBlip(513, new Vector3(200.3088, -1978.828, 19.3329), 1, 49, "Haltestelle(R3)", 255, 0, true); - Blip Blip22 = NAPI.Blip.CreateBlip(513, new Vector3(358.6138, -1785.821, 28.92113), 1, 49, "Haltestelle(R3)", 255, 0, true); - Blip Blip23 = NAPI.Blip.CreateBlip(513, new Vector3(281.8594, -1462.503, 29.13148), 1, 49, "Haltestelle(R3)", 255, 0, true); - Blip Blip24 = NAPI.Blip.CreateBlip(513, new Vector3(77.72239, -1212.086, 29.12294), 1, 49, "Haltestelle(R3)", 255, 0, true); - Blip Blip25 = NAPI.Blip.CreateBlip(513, new Vector3(218.1398, -850.9549, 30.16619), 1, 49, "Haltestelle(R3)", 255, 0, true);*/ - } -} diff --git a/ReallifeGamemode.Server/Job/BusDriver/JobInfoCheckPoints.cs b/ReallifeGamemode.Server/Job/BusDriver/JobInfoCheckPoints.cs deleted file mode 100644 index 4cc381e5..00000000 --- a/ReallifeGamemode.Server/Job/BusDriver/JobInfoCheckPoints.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using GTANetworkAPI; - -namespace ReallifeGamemode.Server.Job.BusDriver -{ - public class JobInfo - { - public Queue Objectives = new Queue(); - public Client Owner { get; set; } - - - public void AddObjective(Vector3 position, float size) - { - ObjectiveInfo objectiveInfo = new ObjectiveInfo(); - objectiveInfo.Position = position; - objectiveInfo.Size = size; - - Objectives.Enqueue(objectiveInfo); - } - - public void StartJob(Client client) - { - Owner = client; - NextObjective(client); - - client.SetData("Job", this); - } - - public void NextObjective(Client client) - { - ObjectiveInfo next_objective = Objectives.Peek(); - client.TriggerEvent("load_objective", next_objective.Position, next_objective.Size); - } - - public void CheckObjective(Client client) - { - ObjectiveInfo current_objective = Objectives.Peek(); - - if (!current_objective.IsInObjective(client)) - return; - - Objectives.Dequeue(); - - if (Objectives.Count == 0) - { - client.SendNotification("Du hast alle ~r~Haltestellen ~w~ abgefahren."); - client.SendNotification("Fahre zurück zum Busbahnhof und bringe deinen Bus zurück."); - client.TriggerEvent("clear_all_markers"); - - return; - } - - NextObjective(client); - } - } -} diff --git a/ReallifeGamemode.Server/Job/BusDriver/ObjectiveInfo.cs b/ReallifeGamemode.Server/Job/BusDriver/ObjectiveInfo.cs deleted file mode 100644 index eb9f57ae..00000000 --- a/ReallifeGamemode.Server/Job/BusDriver/ObjectiveInfo.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using GTANetworkAPI; - -namespace ReallifeGamemode.Server.Job.BusDriver -{ - public class ObjectiveInfo - { - public Vector3 Position { get; set; } - public float Size { get; set; } - - public bool IsInObjective(Client client) - { - return (client.Position.DistanceTo2D(Position) <= Size) ? true : false; - } - } -}