Nachträgliche Migrationsänderung
This commit is contained in:
@@ -3,7 +3,7 @@ using ReallifeGamemode.Server.Services;
|
||||
using GTANetworkAPI;
|
||||
using System.Linq;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
|
||||
using ReallifeGamemode.Server.Job;
|
||||
|
||||
namespace ReallifeGamemode.Server.Util
|
||||
{
|
||||
@@ -17,15 +17,20 @@ namespace ReallifeGamemode.Server.Util
|
||||
player.TriggerEvent("destroyCP");
|
||||
}
|
||||
|
||||
public static void StartCheckPointRoute(Player player, IEnumerable<Vector3> nListCps, int delay, int markerID, int markerSize, string nEvent)
|
||||
public static void StartCheckPointRoute(Player player, IEnumerable<Vector3> nListCps, int delay, int markerID, int markerSize, int markerDist, string nEvent)
|
||||
{
|
||||
|
||||
RemovePlayerHandlerFromList(player);
|
||||
CheckPointListForPlayer playerHandle = new CheckPointListForPlayer(player, nListCps, delay, markerID, markerSize, nEvent);
|
||||
CheckPointListForPlayer playerHandle = new CheckPointListForPlayer(player, nListCps, delay, markerID, markerSize, markerDist, nEvent);
|
||||
playerHandle.DeleteCheckpoints();
|
||||
|
||||
listHandle.Add(playerHandle);
|
||||
|
||||
playerHandle.StartRoute();
|
||||
/*if(player.GetUser().BusSkill >= 1000)
|
||||
{
|
||||
playerHandle.LastCheckpoint = 2;
|
||||
}*/
|
||||
}
|
||||
public static void RemovePlayerHandlerFromList(Player player)
|
||||
{
|
||||
@@ -44,7 +49,6 @@ namespace ReallifeGamemode.Server.Util
|
||||
public void PlayerInCheckpoint(Player user)
|
||||
{
|
||||
CheckPointListForPlayer temp = null;
|
||||
Job.BusDriverJob temp2 = null;
|
||||
for (int a = 0; a < listHandle.Count; a++)
|
||||
{
|
||||
temp = listHandle[a];
|
||||
@@ -55,19 +59,18 @@ namespace ReallifeGamemode.Server.Util
|
||||
}
|
||||
if (temp.LastCheckpoint != 1)
|
||||
{
|
||||
if (user.GetUser().JobId == 3)
|
||||
{
|
||||
PilotJob.payWage(user, 100);
|
||||
}
|
||||
if (user.GetUser().JobId == 4)
|
||||
{
|
||||
Job.BusDriverJob.payWage(user, 100);
|
||||
BusDriverJob.payWage(user, 100);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (user.GetUser().JobId == 4)
|
||||
{
|
||||
Job.BusDriverJob.payWage(user, 200);
|
||||
temp2.BusLetzterCheckpoint(user);
|
||||
}
|
||||
}
|
||||
}
|
||||
temp.NextCheckpoint();
|
||||
}
|
||||
}
|
||||
@@ -80,24 +83,26 @@ namespace ReallifeGamemode.Server.Util
|
||||
public int delay = 0;
|
||||
public int markerID;
|
||||
public int markerSize;
|
||||
public int markerDist;
|
||||
public string eventInCheckpoint = "";
|
||||
|
||||
int checkPointsDone = 0;
|
||||
|
||||
public CheckPointListForPlayer(Player nPlayer, IEnumerable<Vector3> nList, int nDelay, int nMarkerID, int nMarkerSize, string nEvent)
|
||||
public CheckPointListForPlayer(Player nPlayer, IEnumerable<Vector3> nList, int nDelay, int nMarkerID, int nMarkerSize, int nMarkerDist, string nEvent)
|
||||
{
|
||||
this.player = nPlayer;
|
||||
this.list = nList;
|
||||
this.delay = nDelay;
|
||||
this.markerID = nMarkerID;
|
||||
this.markerSize = nMarkerSize;
|
||||
this.markerDist = nMarkerDist;
|
||||
this.eventInCheckpoint = nEvent;
|
||||
this.checkPointsDone = 0;
|
||||
}
|
||||
|
||||
public void StartRoute()
|
||||
{
|
||||
player.TriggerEvent("setCheckPoint", this.list.ElementAt(0), player, 0, this.delay, this.markerID, this.markerSize, this.eventInCheckpoint);
|
||||
player.TriggerEvent("setCheckPoint", this.list.ElementAt(0), player, 0, this.delay, this.markerID, this.markerSize, this.markerDist, this.eventInCheckpoint);
|
||||
}
|
||||
public void NextCheckpoint()
|
||||
{
|
||||
@@ -106,17 +111,29 @@ namespace ReallifeGamemode.Server.Util
|
||||
{
|
||||
LastCheckpoint = 0;
|
||||
Vector3 nextCp = list.ElementAt(checkPointsDone);
|
||||
this.player.TriggerEvent("setCheckPoint", nextCp, player, this.checkPointsDone, delay, this.markerID, this.markerSize, this.eventInCheckpoint);
|
||||
this.player.TriggerEvent("setCheckPoint", nextCp, player, this.checkPointsDone, delay, this.markerID, this.markerSize, this.markerDist, this.eventInCheckpoint);
|
||||
}
|
||||
if (this.list.Count() == checkPointsDone-1)
|
||||
if (checkPointsDone == this.list.Count()-1)
|
||||
{
|
||||
LastCheckpoint = 1;
|
||||
}
|
||||
if (this.list.Count() == checkPointsDone)
|
||||
{
|
||||
LastCheckpoint = 0;
|
||||
CheckPointHandle.RemovePlayerHandlerFromList(this.player);
|
||||
LastCheckpoint = 0;
|
||||
CheckPointHandle.RemovePlayerHandlerFromList(this.player);
|
||||
DeleteCheckpoints();
|
||||
if (player.GetUser().JobId == 3)
|
||||
{
|
||||
PilotJob.payWage(player, 200);
|
||||
PilotJob.PilotLetzterCheckpoint(player);
|
||||
}
|
||||
if (player.GetUser().JobId == 4)
|
||||
{
|
||||
BusDriverJob.payWage(player, 200);
|
||||
BusDriverJob.BusLetzterCheckpoint(player);
|
||||
}
|
||||
}
|
||||
//NAPI.Chat.SendChatMessageToAll($"this.list.Count() = {this.list.Count()}, checkPointsDone = {checkPointsDone}, LastCheckpoint = {LastCheckpoint}");
|
||||
}
|
||||
|
||||
public void DeleteCheckpoints()
|
||||
|
||||
Reference in New Issue
Block a user