vMenu Logging

Heya!
Logging depends on what you know from the script itself.
For example if you know vMenu is calling this event “vMenu:shownames” you can easily capture that event and do something else with it like this

function sendToDiscord(color, name, message, footer)
  local embed = {
        {
            ["color"] = color,
            ["title"] = "**".. name .."**",
            ["description"] = message,
            ["footer"] = {
                ["text"] = footer,
            },
        }
    }

  PerformHttpRequest('DISCORD_URL', function(err, text, headers) end, 'POST', json.encode({username = name, embeds = embed}), { ['Content-Type'] = 'application/json' })
end

AddEventHandler("vMenu:shownames", function() 
  local src = source
  print("event called by ", src)
  sendToDiscord(16753920, "System", "vMenu Names shown", "YourFooter")
end)

Discord Source from: [How-To] Send Discord Webhooks

However it is much harder to log a event from a script that is obfuscated.
The way you can do it in a simple way is to make an extra handler and block the other one

For example if we use vMenu:shownames again and if ur lucky its triggered server sided and you have access to the events source.
You could just remove the “RegisterNetEvent(…)” Part over the handler and create your own handler that handles the request like this

-- same discord function like the top here

RegisterNetEvent("whateveryouwantonamethis")
AddEventHandler("whateveryouwantonamethis", function() 
-- log the event with discord same as top
TriggerEvent("vMenu:shownames", args)
end)

This will work because you removed “RegisterNetEvent()” from the vMenus code so it wont be callable from clients anymore and will only be callable from server sided scripts. Remember this when looking at the code at the top.

There are a lot of ways to log events and its also a very big part of anticheat development for example if you want to make secured events.

Hope this helps. Feel free to ask any questions :smiley: