Conversation
| ConfigShared.devmod = false -- Keep the UI on by default, usefull when tweaking UI | ||
| ConfigShared.UseDefaultUI = true -- Set this to false if you want to use your own UI | ||
|
|
||
| ConfigShared.DiscordLog = 'WEBHOOK HERE' |
There was a problem hiding this comment.
Please add an toggle for this, as not everyone would like this feature
| @@ -0,0 +1,20 @@ | |||
| -- server.lua | |||
| RegisterServerEvent('drift:logToDiscord') | |||
| AddEventHandler('drift:logToDiscord', function(points) | |||
There was a problem hiding this comment.
Just a nit pick, but I prefer RegisterNetEvent, and also fusion the Register and the Handler
RegisterNetEvent('drift:logToDiscord', function(points) ....
| end | ||
| end | ||
|
|
||
| function Modules.DriftCounter.SendDriftDataToServer(points) |
There was a problem hiding this comment.
Using a config option, check if logs are enabled or not before sending the event
| @@ -0,0 +1,20 @@ | |||
| -- server.lua | |||
| RegisterServerEvent('drift:logToDiscord') | |||
| AddEventHandler('drift:logToDiscord', function(points) | |||
There was a problem hiding this comment.
Also not a fan of the points arg not being processed. That mean a cheater could abuse the event, send whatever text he want and spam the discord with it. Maybe filter the arg to only allow numbers, that would at least prevent cheaters from sending whatever they want
Rubylium
left a comment
There was a problem hiding this comment.
Sorry for the delay, added few comments before accepting the PR.
Thanks for the feature
|
Will do once i have time :) |
| ["title"] = "**Drift Points Logged**", | ||
| ["description"] = "Player: " .. playerName .. "\nSteam License: " .. playerIdentifier .. "\nPoints: " .. points, | ||
| ["footer"] = { | ||
| ["text"] = "Drift Logging System By Clin", |
There was a problem hiding this comment.
I understand you want to leave your mark, but ... eh, at least give the option for the user to change this in the config
| AddEventHandler('drift:logToDiscord', function(points) | ||
| local discordWebhook = ConfigShared.DiscordLog -- Replace with your webhook URL | ||
| local playerName = GetPlayerName(source) | ||
| local playerIdentifier = GetPlayerIdentifier(source, 0) -- 0 for license identifier |
There was a problem hiding this comment.
Be carefull with this as depending if the user has steam open or not, the Identifier could change, giving either the steamID, or License
| Modules.DriftCounter.FadeOutHud() | ||
| end | ||
| TriggerEvent(ConfigShared.DriftFinishedEvent, Modules.DriftCounter.CurrentPoints) | ||
| Modules.DriftCounter.SendDriftDataToServer(Modules.DriftCounter.CurrentPoints) -- Add this line here |
Added discord logs using embed message using steamID, steamname, and points.
