Anfang Bussystem + Skill

This commit is contained in:
Mac_Slash
2020-04-27 12:54:19 +02:00
parent 78ccd9a314
commit 929344c1c3
4 changed files with 125 additions and 8 deletions

View File

@@ -2,6 +2,9 @@
using ReallifeGamemode.Server.Services;
using GTANetworkAPI;
using System.Linq;
using ReallifeGamemode.Server.Extensions;
namespace ReallifeGamemode.Server.Util
{
public class CheckPointHandle : Script
@@ -41,6 +44,7 @@ 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];
@@ -49,12 +53,28 @@ namespace ReallifeGamemode.Server.Util
break;
}
}
if (temp.LastCheckpoint != 1)
{
if (user.GetUser().JobId == 4)
{
Job.BusDriverJob.payWage(user, 100);
}
}
else
{
if (user.GetUser().JobId == 4)
{
Job.BusDriverJob.payWage(user, 200);
temp2.BusLetzterCheckpoint(user);
}
}
temp.NextCheckpoint();
}
}
public class CheckPointListForPlayer
{
public int LastCheckpoint;
public IEnumerable<Vector3> list = new List<Vector3>();
public Player player;
public int delay = 0;
@@ -84,17 +104,18 @@ namespace ReallifeGamemode.Server.Util
this.checkPointsDone++;
if (this.list.Count() > checkPointsDone)
{
Vector3 nextCp = list.ElementAt(checkPointsDone);
LastCheckpoint = 0;
Vector3 nextCp = list.ElementAt(checkPointsDone);
this.player.TriggerEvent("setCheckPoint", nextCp, player, this.checkPointsDone, delay, this.markerID, this.markerSize, this.eventInCheckpoint);
}
if (this.list.Count() == checkPointsDone-1)
{
LastCheckpoint = 1;
}
if (this.list.Count() == checkPointsDone)
{
CheckPointHandle.RemovePlayerHandlerFromList(this.player);
if (this.eventInCheckpoint == "busDriverJob")
{
Job.BusDriverJob.payWage(this.player, 1000);
}
LastCheckpoint = 0;
CheckPointHandle.RemovePlayerHandlerFromList(this.player);
}
}