Zum testen: rentcar system

This commit is contained in:
Fabian
2021-05-02 22:53:53 +02:00
parent 60059f45d4
commit 98cd903f4c
13 changed files with 416 additions and 6 deletions

View File

@@ -78,6 +78,9 @@ namespace ReallifeGamemode.Server.Events
player.TriggerEvent("CLIENT:AddPed", 3, "s_m_m_pilot_01", -1621.4542236328125, -3152.724365234375, 13.991769790649414, 50.73009490966797, 0, false, true, 0, "none", true, true, true);//Ped_Pilot LS Airport
player.TriggerEvent("CLIENT:AddPed", 4, "u_m_o_finguru_01", -534.4425659179688, -2145.747314453125, 5.992100715637207, 53.96156692504883, 0, false, true, 0, "none", true, true, true);//Ped Busfahrer
player.TriggerEvent("CLIENT:AddPed", 5, "csb_prolsec", 1690.84, 2591.17 , 45.91, -2.66, 0, false, true, 0, "none", true, true, true);//Ped Knast
player.TriggerEvent("CLIENT:AddPed", 6, "ig_siemonyetarian", -1023.1589, -2693.6948, 13.98, 173.95613, 0, false, true, 0, "none", true, true, true);//Ped Rentcar NoobSpawn
player.TriggerEvent("CLIENT:AddPed", 7, "ig_siemonyetarian", -369.1589, -230.92816, 36.028805, 150.26433, 0, false, true, 0, "none", true, true, true);//Ped Rentcar KH/Stadthalle
player.TriggerEvent("CLIENT:AddPed", 8, "ig_siemonyetarian", 1222.0868, 2726.5286, 38.00415, 113.77263, 0, false, true, 0, "none", true, true, true);//Ped Rentcar Knast
TimeSpan currentTime = TimeManager.CurrentTime;
bool disableLightMode = currentTime > LightModeTimeFrom && currentTime < LightModeTimeTo;

View File

@@ -127,6 +127,11 @@ namespace ReallifeGamemode.Server.Events
}
}
if (Rentcar.mapPlayerRentcarBill.ContainsKey(player.Name))
{
Rentcar.cancelRent(player);
}
//Vehicle LastVehicle = player.GetData<Vehicle>("LastVehicle");
JobBase job = JobManager.GetJob(player.GetUser().JobId ?? -1);
if (job != null)

View File

@@ -1,4 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using GTANetworkAPI;
@@ -188,6 +189,7 @@ namespace ReallifeGamemode.Server.Events
int ticket_amount = 0;
int pay_amount = 0;
bool house = false;
bool hasRentcar = player.GetData<bool>("hasRentcar") == true;
if (u.House != null)
{
@@ -203,7 +205,8 @@ namespace ReallifeGamemode.Server.Events
{
pay_amount = player.GetData<int>("pay_amount");
}
player.TriggerEvent("SERVER:InteractionMenu_OpenMenu", JsonConvert.SerializeObject(accountData), factionleader, JsonConvert.SerializeObject(memberList), JsonConvert.SerializeObject(jobData), faction, group, factionInvite, groupInvite, ticket_boolean, ticket_amount, pay_amount, house);
player.TriggerEvent("SERVER:InteractionMenu_OpenMenu", JsonConvert.SerializeObject(accountData), factionleader, JsonConvert.SerializeObject(memberList), JsonConvert.SerializeObject(jobData), faction, group, factionInvite, groupInvite, ticket_boolean, ticket_amount, pay_amount, JsonConvert.SerializeObject(hasRentcar), house);
}
[RemoteEvent("keyPress:E")]
@@ -233,6 +236,7 @@ namespace ReallifeGamemode.Server.Events
JobPoint nearestJobPoint = PositionManager.JobPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.6);
Player nearestCuffPlayer = PositionManager.cuffPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.6 && user.GetData<bool>("duty"));
AmmunationPoint nearestAmmunationPoint = PositionManager.AmmunationPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5);
RentcarPoint nearestRentcarPoint = PositionManager.rentcarPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5);
if (user?.FactionId != null)
{
@@ -351,6 +355,31 @@ namespace ReallifeGamemode.Server.Events
user.SetBlipAndNametagColor();
}
//Rentcar Points
if (nearestRentcarPoint != null)
{
if (player.IsInVehicle)
{
return;
}
//Noobspawn
if (player.Position.DistanceTo(PositionManager.rentcarPoints[0].Position) <= 1.5)
{
player.TriggerEvent("showRentcarMenu", JsonConvert.SerializeObject(Rentcar.noobspawnVehicleProperties), "noobspawn");
}
//Stadthalle
else if (player.Position.DistanceTo(PositionManager.rentcarPoints[1].Position) <= 1.5)
{
player.TriggerEvent("showRentcarMenu", JsonConvert.SerializeObject(Rentcar.stadthalleVehicleProperties), "stadthalle");
}
//Knast
else if (player.Position.DistanceTo(PositionManager.rentcarPoints[2].Position) <= 1.5)
{
player.TriggerEvent("showRentcarMenu", JsonConvert.SerializeObject(Rentcar.knastVehicleProperties), "knast");
}
}
if (nearestWeapon != null) // Weapon Point
{
List<string> primarys = new List<string>();