add cityhall menu, add self interaction menu (Arrow Down), fix freecam, add group creation, move (faction) invite from commands to menu
This commit is contained in:
@@ -46,6 +46,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
|
||||
GroundItem.PickUpGroundItem(player);
|
||||
}
|
||||
|
||||
[RemoteEvent("keyPress:UP_ARROW")]
|
||||
public void KeyPressUpArrow(Client player)
|
||||
{
|
||||
@@ -55,6 +56,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
ATMManager.ShowAtmUi(player, player.GetData("nearATM"));
|
||||
}
|
||||
}
|
||||
|
||||
[RemoteEvent("keyPress:LEFT_ARROW")]
|
||||
public void KeyPressLeftArrow(Client player)
|
||||
{
|
||||
@@ -78,6 +80,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
player.TriggerEvent("showPlayerInteraction", JsonConvert.SerializeObject(nearbyPlayerList));
|
||||
}
|
||||
}
|
||||
|
||||
[RemoteEvent("keyPress:RIGHT_ARROW")]
|
||||
public void KeyPressRightArrow(Client player)
|
||||
{
|
||||
@@ -92,6 +95,30 @@ namespace ReallifeGamemode.Server.Events
|
||||
}
|
||||
}
|
||||
|
||||
[RemoteEvent("keyPress:DOWN_ARROW")]
|
||||
public void KeyPressDownArrow(Client player)
|
||||
{
|
||||
User u = player.GetUser();
|
||||
if (u == null) return;
|
||||
|
||||
var accountData = new
|
||||
{
|
||||
regDate = u.RegistrationDate.ToShortDateString(),
|
||||
adminLevel = u.AdminLevel.GetName(),
|
||||
faction = u.Faction?.Name ?? "Zivilist",
|
||||
factionRank = u.GetFactionRank().RankName,
|
||||
group = u.Group?.Name ?? "Keine",
|
||||
groupRank = u.GroupRank.GetName()
|
||||
};
|
||||
|
||||
string faction = u.FactionLeader ? u.Faction.Name : null;
|
||||
string group = u.Group?.Name ?? null;
|
||||
bool factionInvite = player.HasData("accept_faction_invite");
|
||||
bool groupInvite = player.HasData("accept_group_invite");
|
||||
|
||||
player.TriggerEvent("SERVER:InteractionMenu_OpenMenu", JsonConvert.SerializeObject(accountData), faction, group, factionInvite, groupInvite);
|
||||
}
|
||||
|
||||
[RemoteEvent("keyPress:E")]
|
||||
public void KeyPressE(Client player)
|
||||
{
|
||||
@@ -99,78 +126,77 @@ namespace ReallifeGamemode.Server.Events
|
||||
var user = player.GetUser();
|
||||
if (user?.FactionId != null)
|
||||
{
|
||||
DutyPoint nearest = PositionManager.DutyPoints.Find(d => d.Position.DistanceTo(player.Position) <= 1.5);
|
||||
DutyPoint nearest = PositionManager.DutyPoints.Find(d => d.Position.DistanceTo(player.Position) <= 1.5 && d.FactionId == user.FactionId);
|
||||
if (nearest == null) return;
|
||||
if (player.Position.DistanceTo(nearest.Position) <= 1.5 && nearest.FactionId == user.FactionId)
|
||||
var nameTagColor = new Color(0, 0, 0);
|
||||
var factionId = user.FactionId;
|
||||
|
||||
if (player.GetData("duty") == false)
|
||||
{
|
||||
var nameTagColor = new Color(0, 0, 0);
|
||||
var factionId = user.FactionId;
|
||||
|
||||
if (player.GetData("duty") == false)
|
||||
player.SetData("duty", true);
|
||||
player.SendNotification("Du bist nun ~g~im Dienst.");
|
||||
if (player.GetUser().FactionId == 2) //Fire Department
|
||||
{
|
||||
player.SetData("duty", true);
|
||||
player.SendNotification("Du bist nun ~g~im Dienst.");
|
||||
if (player.GetUser().FactionId == 2) //Fire Department
|
||||
int medicCount = 0;
|
||||
foreach (Client c in NAPI.Pools.GetAllPlayers())
|
||||
{
|
||||
int medicCount = 0;
|
||||
foreach (Client c in NAPI.Pools.GetAllPlayers())
|
||||
if ((c.GetUser()?.Faction.Id ?? 0) == 2)
|
||||
{
|
||||
if ((c.GetUser()?.Faction.Id ?? 0) == 2)
|
||||
{
|
||||
medicCount++;
|
||||
}
|
||||
medicCount++;
|
||||
}
|
||||
NAPI.ClientEvent.TriggerClientEventForAll("updateDutyMedics", medicCount);
|
||||
}
|
||||
switch (factionId)
|
||||
{
|
||||
//LSPD
|
||||
case 1:
|
||||
nameTagColor = new Color(28, 134, 238);
|
||||
break;
|
||||
}
|
||||
player.NametagColor = nameTagColor;
|
||||
using (var context = new DatabaseContext())
|
||||
{
|
||||
List<CharacterCloth> clothes = context.CharacterClothes.Where(u => u.UserId == user.Id && u.Duty == true).ToList();
|
||||
NAPI.ClientEvent.TriggerClientEventForAll("updateDutyMedics", medicCount);
|
||||
}
|
||||
switch (factionId)
|
||||
{
|
||||
//LSPD
|
||||
case 1:
|
||||
nameTagColor = new Color(28, 134, 238);
|
||||
break;
|
||||
}
|
||||
player.NametagColor = nameTagColor;
|
||||
using (var context = new DatabaseContext())
|
||||
{
|
||||
List<CharacterCloth> clothes = context.CharacterClothes.Where(u => u.UserId == user.Id && u.Duty == true).ToList();
|
||||
|
||||
foreach (var cloth in clothes)
|
||||
foreach (var cloth in clothes)
|
||||
{
|
||||
if (cloth.SlotType == 0)
|
||||
{
|
||||
if (cloth.SlotType == 0)
|
||||
player.SetClothes(cloth.SlotId, cloth.ClothId, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (cloth.ClothId != -1)
|
||||
{
|
||||
player.SetClothes(cloth.SlotId, cloth.ClothId, 0);
|
||||
player.SetAccessories(cloth.SlotId, cloth.ClothId, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (cloth.ClothId != -1)
|
||||
{
|
||||
player.SetAccessories(cloth.SlotId, cloth.ClothId, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
player.ClearAccessory(cloth.SlotId);
|
||||
}
|
||||
player.ClearAccessory(cloth.SlotId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
player.SetData("duty", false);
|
||||
player.SendNotification("Du bist nun ~r~außer Dienst.");
|
||||
NAPI.ClientEvent.TriggerClientEventForAll("updateDutyMedics", false);
|
||||
player.NametagColor = new Color(255, 255, 255);
|
||||
UpdateCharacterCloth.LoadCharacterDefaults(player);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
player.SetData("duty", false);
|
||||
player.SendNotification("Du bist nun ~r~außer Dienst.");
|
||||
NAPI.ClientEvent.TriggerClientEventForAll("updateDutyMedics", false);
|
||||
player.NametagColor = new Color(255, 255, 255);
|
||||
UpdateCharacterCloth.LoadCharacterDefaults(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[RemoteEvent("keyPress:I")]
|
||||
public void KeyPressI(Client player)
|
||||
{
|
||||
if (!player.IsLoggedIn()) return;
|
||||
InventoryManager.GetUserItems(player);
|
||||
}
|
||||
|
||||
[RemoteEvent("keyPress:J")]
|
||||
public void KeyPressJ(Client player)
|
||||
{
|
||||
@@ -191,6 +217,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
}
|
||||
player.TriggerEvent("fetchPlayerList", JsonConvert.SerializeObject(ListPlayers));
|
||||
}
|
||||
|
||||
[RemoteEvent("keyPress:K")]
|
||||
public void KeyPressK(Client player)
|
||||
{
|
||||
@@ -244,12 +271,14 @@ namespace ReallifeGamemode.Server.Events
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[RemoteEvent("keyPress:L")]
|
||||
public void KeyPressL(Client player)
|
||||
{
|
||||
if (!player.IsLoggedIn()) return;
|
||||
DoorManager.ChangeDoorState(player);
|
||||
}
|
||||
|
||||
[RemoteEvent("keyPress:N")]
|
||||
public void KeyPressN(Client player)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user