diff --git a/server-data/resources/[esx]/es_extended/client/modules/adjustments.lua b/server-data/resources/[esx]/es_extended/client/modules/adjustments.lua index 0097215e..8c4743af 100644 --- a/server-data/resources/[esx]/es_extended/client/modules/adjustments.lua +++ b/server-data/resources/[esx]/es_extended/client/modules/adjustments.lua @@ -171,44 +171,6 @@ local placeHolders = { end, } -function Adjustments:PresencePlaceholders() - local presence = Config.DiscordActivity.presence - - for placeholder, cb in pairs(placeHolders) do - local success, result = pcall(cb) - - if not success then - error(("Failed to execute presence placeholder: ^5%s^7"):format(placeholder)) - error(result) - return "Unknown" - end - - presence = presence:gsub(("{%s}"):format(placeholder), result) - end - - return presence -end - -function Adjustments:DiscordPresence() - if Config.DiscordActivity.appId ~= 0 then - CreateThread(function() - while true do - SetDiscordAppId(Config.DiscordActivity.appId) - SetDiscordRichPresenceAsset(Config.DiscordActivity.assetName) - SetDiscordRichPresenceAssetText(Config.DiscordActivity.assetText) - - for i = 1, #Config.DiscordActivity.buttons do - local button = Config.DiscordActivity.buttons[i] - SetDiscordRichPresenceAction(i - 1, button.label, button.url) - end - - SetRichPresence(self:PresencePlaceholders()) - Wait(Config.DiscordActivity.refresh) - end - end) - end -end - function Adjustments:WantedLevel() if not Config.EnableWantedLevel then ClearPlayerWantedLevel(ESX.playerId) @@ -236,7 +198,6 @@ function Adjustments:Load() self:DispatchServices() self:NPCScenarios() self:LicensePlates() - self:DiscordPresence() self:WantedLevel() self:DisableRadio() end diff --git a/server-data/resources/[esx]/es_extended/shared/config/adjustments.lua b/server-data/resources/[esx]/es_extended/shared/config/adjustments.lua index ae7b8a46..059bfb45 100644 --- a/server-data/resources/[esx]/es_extended/shared/config/adjustments.lua +++ b/server-data/resources/[esx]/es_extended/shared/config/adjustments.lua @@ -43,28 +43,3 @@ Config.RemoveHudComponents = { --Any other character will lead to said character being emitted. -- A string shorter than 8 characters will be padded on the right. Config.CustomAIPlates = "........" -- Custom plates for AI vehicles - ---[[ - PlaceHolders: - {server_name} - Server Display Name - {server_endpoint} - Server IP:Server Port - {server_players} - Current Player Count - {server_maxplayers} - Max Player Count - - {player_name} - Player Name - {player_rp_name} - Player RP Name - {player_id} - Player ID - {player_street} - Player Street Name -]] - -Config.DiscordActivity = { - appId = 0, -- Discord Application ID, - assetName = "LargeIcon", --image name for the "large" icon. - assetText = "{server_name}", -- Text to display on the asset - buttons = { - { label = "Join Server", url = "fivem://connect/{server_endpoint}" }, - { label = "Discord", url = "https://discord.esx-framework.org" }, - }, - presence = "{player_name} [{player_id}] | {server_players}/{server_maxplayers}", - refresh = 1 * 60 * 1000, -- 1 minute -}