From 043d821f6ecb30f9a9d78a23c33f726f4494f182 Mon Sep 17 00:00:00 2001 From: "Mr. K V" <36492979+69u@users.noreply.github.com> Date: Tue, 25 Jul 2023 22:33:26 +0800 Subject: [PATCH] prepping for ccDiscordWrapper v1.1.0 --- fxmanifest.lua | 2 +- server/main.lua | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/fxmanifest.lua b/fxmanifest.lua index 86d31fc..39e8b60 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -3,7 +3,7 @@ games { 'rdr3', 'gta5' } author 'Concept Collective ' description 'A FiveM RP Chat resource utilising cc-chat.' -version '1.4.1' +version '1.4.2' lua54 'yes' diff --git a/server/main.lua b/server/main.lua index 3ab7c87..ec1a220 100644 --- a/server/main.lua +++ b/server/main.lua @@ -57,7 +57,7 @@ RegisterCommand('ooc', function(source, args, rawCommand) return end if config.discord then - playerName = "["..exports.ccDiscordWrapper:getPlayerDiscordHighestRole(source).."] "..GetPlayerName(source) + playerName = "["..exports.ccDiscordWrapper:getPlayerDiscordHighestRole(source, "name").."] "..GetPlayerName(source) elseif config.esx then local xPlayer = ESX.GetPlayerFromId(source) playerName = xPlayer.getName() @@ -92,7 +92,7 @@ AddEventHandler('chatMessage', function(source, name, message) return end if config.discord then - playerName = "["..exports.ccDiscordWrapper:getPlayerDiscordHighestRole(source).."] "..GetPlayerName(source) + playerName = "["..exports.ccDiscordWrapper:getPlayerDiscordHighestRole(source, "name").."] "..GetPlayerName(source) elseif config.esx then local xPlayer = ESX.GetPlayerFromId(source) playerName = xPlayer.getName() @@ -126,7 +126,7 @@ RegisterCommand('me', function(source, args, rawCommand) return end if config.discord then - playerName = "["..exports.ccDiscordWrapper:getPlayerDiscordHighestRole(source).."] "..GetPlayerName(source) + playerName = "["..exports.ccDiscordWrapper:getPlayerDiscordHighestRole(source, "name").."] "..GetPlayerName(source) elseif config.esx then local xPlayer = ESX.GetPlayerFromId(source) playerName = xPlayer.getName() @@ -160,7 +160,7 @@ RegisterCommand('do', function(source, args, rawCommand) return end if config.discord then - playerName = "["..exports.ccDiscordWrapper:getPlayerDiscordHighestRole(source).."] "..GetPlayerName(source) + playerName = "["..exports.ccDiscordWrapper:getPlayerDiscordHighestRole(source, "name").."] "..GetPlayerName(source) elseif config.esx then local xPlayer = ESX.GetPlayerFromId(source) playerName = xPlayer.getName() @@ -193,7 +193,7 @@ RegisterCommand('news', function(source, args, rawCommand) return end if config.discord then - playerName = "["..exports.ccDiscordWrapper:getPlayerDiscordHighestRole(source).."] "..GetPlayerName(source) + playerName = "["..exports.ccDiscordWrapper:getPlayerDiscordHighestRole(source, "name").."] "..GetPlayerName(source) elseif config.esx then local xPlayer = ESX.GetPlayerFromId(source) playerName = xPlayer.getName() @@ -226,7 +226,7 @@ RegisterCommand('ad', function(source, args, rawCommand) return end if config.discord then - playerName = "["..exports.ccDiscordWrapper:getPlayerDiscordHighestRole(source).."] "..GetPlayerName(source) + playerName = "["..exports.ccDiscordWrapper:getPlayerDiscordHighestRole(source, "name").."] "..GetPlayerName(source) elseif config.esx then local xPlayer = ESX.GetPlayerFromId(source) playerName = xPlayer.getName() @@ -259,7 +259,7 @@ RegisterCommand('twt', function(source, args, rawCommand) return end if config.discord then - playerName = "["..exports.ccDiscordWrapper:getPlayerDiscordHighestRole(source).."] "..GetPlayerName(source) + playerName = "["..exports.ccDiscordWrapper:getPlayerDiscordHighestRole(source, "name").."] "..GetPlayerName(source) elseif config.esx then local xPlayer = ESX.GetPlayerFromId(source) playerName = xPlayer.getName() @@ -292,7 +292,7 @@ RegisterCommand('anon', function(source, args, rawCommand) return end if config.discord then - playerName = "["..exports.ccDiscordWrapper:getPlayerDiscordHighestRole(source).."] "..GetPlayerName(source) + playerName = "["..exports.ccDiscordWrapper:getPlayerDiscordHighestRole(source, "name").."] "..GetPlayerName(source) elseif config.esx then local xPlayer = ESX.GetPlayerFromId(source) playerName = xPlayer.getName() @@ -324,7 +324,7 @@ if config.connectionMessages then playerName = GetPlayerName(source) TriggerClientEvent('cc-rpchat:addMessage', -1, '#e74c3c', 'fa-solid fa-minus', playerName..' left (' .. reason .. ')', '', false) if config.DiscordWebhook then - sendToDiscord(13644844, playerName.." has disconnected!", "**Identifiers**: \n"..GetPlayerIdentifier(source, 0).."\n"..GetPlayerIdentifier(source, 1).."\n<@"..GetPlayerIdentifier(source, 2):sub(9)..">\n"..GetPlayerIdentifier(source, 3), 'add a custom footer') + sendToDiscord(13644844, playerName.." has disconnected ("..reason..")!", "**Identifiers**: \n"..GetPlayerIdentifier(source, 0).."\n"..GetPlayerIdentifier(source, 1).."\n<@"..GetPlayerIdentifier(source, 2):sub(9)..">\n"..GetPlayerIdentifier(source, 3), 'add a custom footer') end end) end