test carwash

This commit is contained in:
michael.reiswich
2021-05-10 18:30:34 +02:00
parent cec8048a1e
commit 490a71c3e3
4 changed files with 83 additions and 1 deletions

View File

@@ -4025,6 +4025,12 @@ namespace ReallifeGamemode.Server.Commands
}
}
[Command("washcar", "~m~Benutzung: ~s~/washcar")]
public void washcar(Player player)
{
player.TriggerEvent("washcar");
}
[Command("makeadmin", "~m~Benutzung: ~s~/makeadmin [Name] [Adminlevel]")]
public void CmdAdminMakeadmin(Player player, string name, int rank)
{

View File

@@ -7,6 +7,9 @@ using ReallifeGamemode.Server.Shop.Friseur;
using ReallifeGamemode.Server.Util;
using ReallifeGamemode.Server.Extensions;
using ReallifeGamemode.Server.Shop.Ammunation;
using ReallifeGamemode.Database.Entities;
using ReallifeGamemode.Database.Models;
namespace ReallifeGamemode.Server.Managers
{
@@ -34,6 +37,9 @@ namespace ReallifeGamemode.Server.Managers
public static List<RentcarPoint> rentcarPoints = new List<RentcarPoint>();
public static List<CarwashPoint> carwashPoints = new List<CarwashPoint>();
public static Vector3 eventportPosition;
public static bool eventportActive = false;
@@ -347,9 +353,55 @@ namespace ReallifeGamemode.Server.Managers
NAPI.Blip.CreateBlip(88, new Vector3(point.Position.X, point.Position.Y, point.Position.Z), (float)0.7, 59, "Fahrzeugverleih", 255, 200, true, 0, 0);
}
#endregion RentCar
#region Carwash
CarwashPoint Carwash = new CarwashPoint()
{
Position = new Vector3(26.37, -1391.99, 29.36)
};
CarwashPoint Carwash2 = new CarwashPoint()
{
Position = new Vector3(111, 111, 29.32)
};
carwashPoints.Add(Carwash);
carwashPoints.Add(Carwash2);
foreach (CarwashPoint point in carwashPoints)
{
NAPI.Marker.CreateMarker(1, new Vector3(point.Position.X, point.Position.Y, point.Position.Z - 2), new Vector3(point.Position.X, point.Position.Y, point.Position.Z + 1),
new Vector3(0, 0, 0), 5.5f, new Color(255, 255, 255, 50), false, 0);
NAPI.TextLabel.CreateTextLabel("~y~Autowaschanlage", point.Position, 7, 1, 0, new Color(255, 255, 255), false, 0);
NAPI.Blip.CreateBlip(100, new Vector3(point.Position.X, point.Position.Y, point.Position.Z), (float)0.7, 0, "´Carwash", 255, 200, true, 0, 0);
Vector3 pos = point.Position;
ColShape colShape = NAPI.ColShape.CreateSphereColShape(pos, 5, 0);
colShape.OnEntityEnterColShape += (cs, c) =>
{
if (!c.IsInVehicle) return;
c.TriggerEvent("washcar");
using (var dbcontext = new DatabaseContext())
{
User u = c.GetUser(dbcontext);
u.BankAccount.Balance -= 100;
dbcontext.SaveChanges();
}
c.SendNotification("Die Autowäsche hat dich ~g~$~w~100 gekostet.");
};
}
#endregion Carwash
}
#endregion RentCar
[RemoteEvent("sendClientToStage")]
public void ElevatorSendToStage(Player player, string level)
{
@@ -486,3 +538,8 @@ public class RentcarPoint
public Vector3 Position { get; set; }
}
public class CarwashPoint
{
public Vector3 Position { get; set; }
}