add introduction at noobspawn

This commit is contained in:
michael.reiswich
2021-01-18 15:36:33 +01:00
parent f52c813514
commit f18c47c530
9 changed files with 291 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
/**
* @overview Life of German Reallife - Managers Interaction (InteractionManager.cs)
* @author MichaPlays
* @copyright (c) 2008 - 2018 Life of German
* @copyright (c) 2008 - 2021 Life of German
*/
using GTANetworkAPI;
using Newtonsoft.Json;

View File

@@ -17,6 +17,7 @@ using ReallifeGamemode.Server.Util;
using ReallifeGamemode.Services;
using System.Threading;
using Microsoft.EntityFrameworkCore;
using ReallifeGamemode.Server.newbie;
/**
* @overview Life of German Reallife - Main Class (Main.cs)
@@ -130,6 +131,7 @@ namespace ReallifeGamemode.Server
PlaneSchool.Setup();
Gangwar.Gangwar.loadTurfs();
Bank.bank.Setup();
Introduction.Setup();
TempBlip tempBlip = new TempBlip()
{

View File

@@ -0,0 +1,17 @@
using System.Linq;
using GTANetworkAPI;
using ReallifeGamemode.Database;
using ReallifeGamemode.Database.Entities;
using ReallifeGamemode.Database.Entities.Logs;
using ReallifeGamemode.Database.Models;
using ReallifeGamemode.Server.Util;
namespace ReallifeGamemode.Server.Managers
{
class NewbieManager : Script
{
}
}

View File

@@ -0,0 +1,46 @@
using GTANetworkAPI;
using Newtonsoft.Json;
using ReallifeGamemode.Database.Models;
using ReallifeGamemode.Server.Extensions;
using ReallifeGamemode.Server.Finance;
using ReallifeGamemode.Services;
using System;
/**
* @overview Life of German Reallife - Managers Interaction (InteractionManager.cs)
* @author MichaPlays
* @copyright (c) 2008 - 2021 Life of German
*/
namespace ReallifeGamemode.Server.newbie
{
class Introduction : Script
{
private static TextLabel informationLabel;
private static Marker marker;
private static ColShape _colShape;
public static Vector3 Position { get; }
public static void Setup()
{
informationLabel = NAPI.TextLabel.CreateTextLabel("Einführung", new Vector3(-1025.57, -2732.15, 13.75), 20.0f, 1.3f, 0, new Color(255, 255, 255));
marker = NAPI.Marker.CreateMarker(MarkerType.VerticalCylinder, new Vector3(-1025.57, -2732.15, 12.75), new Vector3(), new Vector3(), 2f, new Color(107, 0, 0));
_colShape = NAPI.ColShape.CreateSphereColShape(new Vector3(-1025.57, -2732.15, 13.75), 2f);
_colShape.OnEntityEnterColShape += EntityEnterBankColShape;
_colShape.OnEntityExitColShape += EntityExitBankColShape;
}
private static void EntityEnterBankColShape(ColShape colShape, Player client)
{
if (client.IsInVehicle || !client.IsLoggedIn()) return;
client.TriggerEvent("showIntroduction");
}
private static void EntityExitBankColShape(ColShape colShape, Player client)
{
client.TriggerEvent("removeIntroduction");
}
}
}