Erweiterung für Busfahrer, CheckpointSystem, PilotJob, Skillsystem, AdminBefehle
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using GTANetworkAPI;
|
||||
using ReallifeGamemode.Server.Util;
|
||||
@@ -167,83 +167,93 @@ namespace ReallifeGamemode.Server.Job
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
if (player.GetUser().PilotSkill < 300)
|
||||
{
|
||||
Random rnd = new Random();
|
||||
int rroute = rnd.Next(1, 4);
|
||||
switch (rroute)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
StartPilotRoute(player, "Route 1");
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
StartPilotRoute(player, "Route 2");
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
StartPilotRoute(player, "Route 3");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (player.GetUser().PilotSkill >= 300)
|
||||
{
|
||||
Random rnd = new Random();
|
||||
int rroute = rnd.Next(1, 4);
|
||||
switch (rroute)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
StartPilotRoute(player, "Route 4");
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
StartPilotRoute(player, "Route 5");
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
StartPilotRoute(player, "Route 6");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
[RemoteEvent("startPilotRoute")]
|
||||
public void StartPilotRoute(Player player, string type)
|
||||
{
|
||||
//if (player.VehicleSeat == 0)
|
||||
//{
|
||||
Vehicle veh = player.Vehicle;
|
||||
if (player.VehicleSeat == 0)
|
||||
{
|
||||
if (type == "RouteStart")
|
||||
{
|
||||
if (player.HasData("PilotenBase") && player.GetData<int>("PilotenBase") == 1)
|
||||
{
|
||||
Random rnd = new Random();
|
||||
int rroute = rnd.Next(1, 4);
|
||||
switch (rroute)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
CheckPointHandle.StartCheckPointRoute(player, Route1, 0, 6, 40, 20, true, "pilotJob"); //6, 23, 25, 26, 27, 28
|
||||
player.SendChatMessage("~y~[JOB] ~w~Route wurde gesetzt.: ~g~Route 1");
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
CheckPointHandle.StartCheckPointRoute(player, Route2, 0, 6, 40, 20, true, "pilotJob"); //6, 23, 25, 26, 27, 28
|
||||
player.SendChatMessage("~y~[JOB] ~w~Route wurde gesetzt.: ~g~Route 2");
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
CheckPointHandle.StartCheckPointRoute(player, Route3, 0, 6, 40, 20, true, "pilotJob"); //6, 23, 25, 26, 27, 28
|
||||
player.SendChatMessage("~y~[JOB] ~w~Route wurde gesetzt.: ~g~Route 3");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (player.HasData("PilotenBase") && player.GetData<int>("PilotenBase") == 2)
|
||||
{
|
||||
Random rnd = new Random();
|
||||
int rroute = rnd.Next(1, 4);
|
||||
switch (rroute)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
CheckPointHandle.StartCheckPointRoute(player, Route4, 0, 6, 40, 20, true, "pilotJob"); //6, 23, 25, 26, 27, 28
|
||||
player.SendChatMessage("~y~[JOB] ~w~Route wurde gesetzt.: ~g~Route 4");
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
CheckPointHandle.StartCheckPointRoute(player, Route5, 0, 6, 40, 20, true, "pilotJob"); //6, 23, 25, 26, 27, 28
|
||||
player.SendChatMessage("~y~[JOB] ~w~Route wurde gesetzt.: ~g~Route 5");
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
CheckPointHandle.StartCheckPointRoute(player, Route6, 0, 6, 40, 20, true, "pilotJob"); //6, 23, 25, 26, 27, 28
|
||||
player.SendChatMessage("~y~[JOB] ~w~Route wurde gesetzt.: ~g~Route 6");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (type == "Route 1")
|
||||
{
|
||||
CheckPointHandle.StartCheckPointRoute(player, Route1, 0, 6, 40, 30, "pilotJob"); //6, 23, 25, 26, 27, 28
|
||||
CheckPointHandle.StartCheckPointRoute(player, Route1, 0, 6, 40, 20, true, "pilotJob"); //6, 23, 25, 26, 27, 28
|
||||
}
|
||||
else if (type == "Route 2")
|
||||
{
|
||||
CheckPointHandle.StartCheckPointRoute(player, Route2, 0, 6, 40, 30, "pilotJob");
|
||||
CheckPointHandle.StartCheckPointRoute(player, Route2, 0, 6, 40, 20, true, "pilotJob");
|
||||
}
|
||||
else if (type == "Route 3")
|
||||
{
|
||||
CheckPointHandle.StartCheckPointRoute(player, Route3, 0, 6, 40, 30, "pilotJob");
|
||||
CheckPointHandle.StartCheckPointRoute(player, Route3, 0, 6, 40, 20, true, "pilotJob");
|
||||
}
|
||||
else if (type == "Route 4")
|
||||
{
|
||||
CheckPointHandle.StartCheckPointRoute(player, Route4, 0, 6, 40, 30, "pilotJob");
|
||||
CheckPointHandle.StartCheckPointRoute(player, Route4, 0, 6, 40, 20, true, "pilotJob");
|
||||
}
|
||||
else if (type == "Route 5")
|
||||
{
|
||||
CheckPointHandle.StartCheckPointRoute(player, Route5, 0, 6, 40, 30, "pilotJob");
|
||||
CheckPointHandle.StartCheckPointRoute(player, Route5, 0, 6, 40, 20, true, "pilotJob");
|
||||
}
|
||||
else if (type == "Route 6")
|
||||
{
|
||||
CheckPointHandle.StartCheckPointRoute(player, Route6, 0, 6, 40, 30, "pilotJob");
|
||||
CheckPointHandle.StartCheckPointRoute(player, Route6, 0, 6, 40, 20, true, "pilotJob");
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
public static void payWage(Player jobber, int wage)
|
||||
{
|
||||
@@ -252,7 +262,7 @@ namespace ReallifeGamemode.Server.Job
|
||||
if (jobber.VehicleSeat == 0)
|
||||
{
|
||||
jobber.GetUser(dbContext).Wage += wage;
|
||||
jobber.SendNotification($"~y~[JOB] ~g~+{wage}$");
|
||||
//jobber.SendNotification($"~y~[JOB] ~g~+{wage}$");
|
||||
jobber.GetUser(dbContext).PilotSkill++;
|
||||
dbContext.SaveChanges();
|
||||
if (jobber.GetUser(dbContext).PilotSkill == 300)
|
||||
@@ -275,7 +285,7 @@ namespace ReallifeGamemode.Server.Job
|
||||
{
|
||||
PilotJob c = new PilotJob();
|
||||
Vehicle v = player.Vehicle;
|
||||
if (v.Model == (uint)Types.VehicleModel.Cuban800)
|
||||
if (player.HasData("PilotenBase") && player.GetData<int>("PilotenBase") == 1)
|
||||
{
|
||||
Random rnd = new Random();
|
||||
int rroute = rnd.Next(1, 4);
|
||||
@@ -301,7 +311,7 @@ namespace ReallifeGamemode.Server.Job
|
||||
}
|
||||
}
|
||||
}
|
||||
if (v.Model == (uint)Types.VehicleModel.Velum || v.Model == (uint)Types.VehicleModel.Velum2)
|
||||
if (player.HasData("PilotenBase") && player.GetData<int>("PilotenBase") == 2)
|
||||
{
|
||||
Random rnd = new Random();
|
||||
int rroute = rnd.Next(1, 4);
|
||||
|
||||
Reference in New Issue
Block a user