Anfang Bussystem + Skill
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user