[+] Elevator System. + FIB, LSED, Ballas & GS duty / weapon rack
This commit is contained in:
@@ -134,6 +134,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
DutyPoint nearestDuty = PositionManager.DutyPoints.Find(d => d.Position.DistanceTo(player.Position) <= 1.5 && d.FactionId == user.FactionId);
|
||||
WeaponPoint nearestWeapon = PositionManager.WeaponPoints.Find(w => w.Position.DistanceTo(player.Position) <= 1.5 && w.FactionId == user.FactionId);
|
||||
JailReleasePoint nearestJailReleasePoint = PositionManager.JailReleasePoints.Find(j => j.Position.DistanceTo(player.Position) <= 1.5 && (user.FactionId == 1 || user.FactionId == 3) && user.GetData<bool>("duty"));
|
||||
ElevatorPoint nearestElevatorPoint = PositionManager.ElevatorPoints.Find(e => e.Position.DistanceTo(player.Position) <= 1.5 && (user.FactionId == 1 || user.FactionId == 3));
|
||||
if (nearestDuty != null)// Duty Point
|
||||
{
|
||||
var nameTagColor = new Color(0, 0, 0);
|
||||
@@ -173,6 +174,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
case 3:
|
||||
nameTagColor = new Color(173, 0, 118);
|
||||
player.SetSharedData("blipColor", 83);
|
||||
player.SetAccessories(2, 2, 0);
|
||||
break;
|
||||
}
|
||||
player.NametagColor = nameTagColor;
|
||||
@@ -266,6 +268,18 @@ namespace ReallifeGamemode.Server.Events
|
||||
}
|
||||
player.TriggerEvent("showJailMenu", JsonConvert.SerializeObject(criminals.ToArray()));
|
||||
}
|
||||
if (nearestElevatorPoint != null)
|
||||
{
|
||||
List<string> stages = new List<string>();
|
||||
foreach(var e in PositionManager.ElevatorPoints)
|
||||
{
|
||||
if(e.Position.DistanceTo2D(player.Position) <= 25 && e.Position.DistanceTo(player.Position) > 1.5)
|
||||
{
|
||||
stages.Add(e.Stage);
|
||||
}
|
||||
}
|
||||
player.TriggerEvent("showElevatorMenu", JsonConvert.SerializeObject(stages.ToArray()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@ namespace ReallifeGamemode.Server.Events
|
||||
else
|
||||
{
|
||||
player.ClearAccessory(0);
|
||||
player.ClearAccessory(1);
|
||||
player.ClearAccessory(2);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -151,4 +153,4 @@ namespace ReallifeGamemode.Server.Events
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
22
ReallifeGamemode.Server/Events/UpdateCharacterElevator.cs
Normal file
22
ReallifeGamemode.Server/Events/UpdateCharacterElevator.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using GTANetworkAPI;
|
||||
using ReallifeGamemode.Server.Managers;
|
||||
|
||||
|
||||
namespace ReallifeGamemode.Server.Events
|
||||
{
|
||||
public class UpdateCharacterElevator : Script
|
||||
{
|
||||
[RemoteEvent("sendClientToStage")]
|
||||
public void SaveWeaponSelection(Client client, string stage)
|
||||
{
|
||||
ElevatorPoint elevator = PositionManager.ElevatorPoints.Find(e => e.Stage == stage);
|
||||
if(elevator != null)
|
||||
{
|
||||
client.Position = elevator.Position;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user