I’m looking at the function to send from other resources to this and then to discord. I get how to add the new channel to this script, but I’m looking at things like our /ad, /ooc, etc… The example below is our Advert script that uses /ad. I “think” I have the string your stated above in the right place but really, I have no idea what I’m doing and I don’t know what I would need to put in to get it to send all the info from the advert.
AddEventHandler('chatMessage', function(source, name, msg)
sm = stringsplit(msg, " ");
if sm[1] == "/ad" then
CancelEvent()
TriggerClientEvent('chatMessage', -1, "ADVERT | " .. name, { 139, 142, 247 }, string.sub(msg,5))
--export to jd discord
exports.JD_logs:discord('<MESSAGE_YOU_WANT_TO_POST_IN_THE_EMBED>', '1752220', '<ADVERT2DISCORD>')
end
end)
function stringsplit(inputstr, sep)
if sep == nil then
sep = "%s"
end
local t={} ; i=1
for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
t[i] = str
i = i + 1
end
return t
end
Thank you for the reply!! I am not a coder/developer by any means but I understand just enough to mostly follow what I am looking at and was 85% sure that is what was needed to be put there, but that 15% unsure portion of me thought yea, lets ask and make sure!
One more question, our current server to discord resource (I believe it’s from Tazio), when someone dies, it just reports every death as “‘whoeveritis’ was killed by an unknown force”. It doesn’t actually tell us in discord who killed them or how they were killed which is an issue for me as one of the main reasons for wanting logs to discord is to see who killed someone when we have to investigate reports of RDM. Will this one actually report deaths properly?
How would I add this to track when players give money/items. Also How to track banking transfers. I undersatnd to add the exports.JD_logs:discord(’<MESSAGE_YOU_WANT_TO_POST_IN_THE_EMBED>’, ‘1752220’, ‘<WEBHOOK_CHANNEL>’
Where i want the log to be generated. But how to i tell it to print what was transferred?
Thanks
I got it all setup and created a channel for the shooting and death notices to go to and when we tested, it showed someone shot a gun and in a separate post, showed a person dying, but did not say how they died or who actually killed them. https://gyazo.com/f8523b6ad2e6e74c72a9d16cb1fd8a60
No problem, Also, is it possible to turn off the shoot function? We noticed when someone used a jerry can to refuel their car, it spammed the heck out of that discord channel (not a huge deal as I moved the shoot webhook to it’s own channel that we can ignore, but really, we don’t need that particular function for our use)
Now that you released the update (thank you for that by the way!) I just noticed something else that I was curious if it could be added next time you update this again. Is there anyway the chat section can show the server ID of the person talking in the logs? Mainly, when someone spams chat (or when someone with a mod menu launches an attack that also spams chat), it’s nice to have the player ID so we can quickly kick or ban them as needed without having to take the extra time to look up their ID (especially those times where they are using a mod menu that is lagging the server enough it makes it hard to look up IDs)