Add faction rank management CEF
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using GTANetworkAPI;
|
||||
using Newtonsoft.Json;
|
||||
using reallife_gamemode.Model;
|
||||
using reallife_gamemode.Server.Entities;
|
||||
using reallife_gamemode.Server.Extensions;
|
||||
@@ -62,5 +63,24 @@ namespace reallife_gamemode.Server.Commands
|
||||
ChatService.BroadcastFaction(broadcastMessage, context.Factions.ToList().FindAll(c => c.StateOwned));
|
||||
}
|
||||
}
|
||||
|
||||
[Command("managefactionranks")]
|
||||
public void CmdFactionManageFactionRanks(Client player)
|
||||
{
|
||||
Entities.Faction f = player.GetFaction();
|
||||
if (f == null)
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
}
|
||||
|
||||
using(var context = new DatabaseContext())
|
||||
{
|
||||
List<FactionRank> factionRanks = context.FactionRanks.ToList().FindAll(r => r.FactionId == f.Id);
|
||||
string json = JsonConvert.SerializeObject(factionRanks, Formatting.Indented);
|
||||
player.TriggerEvent("manageFactionRanks", json);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user