add introduction at noobspawn
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
17
ReallifeGamemode.Server/Managers/NewbieManager.cs
Normal file
17
ReallifeGamemode.Server/Managers/NewbieManager.cs
Normal 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
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
46
ReallifeGamemode.Server/newbie/Introduction.cs
Normal file
46
ReallifeGamemode.Server/newbie/Introduction.cs
Normal 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");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user