JohnnyS / JD_logsV3

JD Logs V3 by Prefech/JokeDevil. I was a admin on the discord, not sure what happened to him. This is no longer being maintained.
35 stars 26 forks source link

From the Docs website in case it goes down as well

I am/was (not even sure) a admin on the Prefech Discord. I am not sure what is going on with Prefech/JokeDevil but I wanted to upload these for those that need it. If you have a updated version OR the source code please let me know so I can update this but this should be working. Hopefully it works like this.

Requirements

Main Features

After you have installed JD_logs you can open the config file and change the settings to your needs. You will find the config file in the config folder.

When you just installed JD_logs your config should look like this:

{
    "prefix":"!jdlogs ",
    "token": "",
    "guildId": "",
    "TimezoneOffset": "+00:00",
    "language": "en",

    "NameChangePerms": "jd.staff",
    "screenshotPerms": "jd.staff",

    "allLogs": true,

    "weaponLog": true,
    "damageLog": true,
    "deathLog": true,

    "playerId": true,
    "postals": true,
    "playerHealth": true,
    "playerArmor": true,
    "playerPing": true,

    "ip": true,
    "steamUrl": true,
    "discordId": {
        "enabled": true,
        "spoiler": true
    },
    "steamId": {
        "enabled": true,
        "spoiler": true
    },
    "license": {
        "enabled": true,
        "spoiler": true
    },

    "WebhookResetMessage": false,

    "WeaponsNotLogged": [
        "WEAPON_SNOWBALL",
        "WEAPON_FIREEXTINGUISHER",
        "WEAPON_PETROLCAN"
    ],

    "DiscordAcePerms": {
        "DISCORD_ROLE_ID": {
            "groups": ["group.admin", "group.mod"],
            "perms": ["jd.staff"]
        }
    }
}

Config settings:

Basic Settings

Ace perms

Additional Settings

Player Details

Rest of the settings

How to log

To make custom logs you will need to have some coding knowledge! We only provide the export we can not help you make use of it.

If you run into issues you can always open a ticket but there won’t be guarantee that we can help.

To create custom logs you will need to add the export to the event/function or command you want to log. This is in the resource you want to log You can use the command !jdlogs create on your discord server to setup a custom logs channel.

exports.JD_logsV3:createLog({
  EmbedMessage = "Embed Message",
  player_id = SERVER_ID_PLAYER_ONE,
  player_2_id = SERVER_ID_PLAYER_TWO,
  channel = "Channel name from channels.json | Discord Channel ID | Discord Webhook URL",
  screenshot = true,
    screenshot_2 = true,
    title = 'Custom Title',
    color = '#A1A1A1',
    icon = '✅'
})

If you change the name of the resource make sure you update that on the logs export as well

Since making custom logs are depending on what you want to logs i can not give any examples other than some standalone commands.

Using the export with no player details!
RegisterCommand("tweet", function(source, args, rawCommand)
    TriggerClientEvent('chatMessage', -1, "Tweet | " .. GetPlayerName(source)..": "..rawCommand:gsub("tweet ", ""), { 201, 201, 201 })
    exports.JD_logsV3:createLog({
        EmbedMessage = "Tweet | " .. GetPlayerName(source)..": "..rawCommand:gsub("tweet ", ""),
        channel = "tweet",
        screenshot = false
    })
end)

for server-side resources player_id will be source on client-side this will be GetPlayerServerId(PlayerId())
Keep in mind these might also change depending on the framework

RegisterCommand("me", function(source, args, rawCommand)
    TriggerClientEvent('chatMessage', -1, "ME | " .. GetPlayerName(source)..": "..rawCommand:gsub("me", ""), { 201, 201, 201 })
    exports.JD_logsV3:createLog({
        EmbedMessage = "ME | " .. GetPlayerName(source)..": "..rawCommand:gsub("me", ""),
        player_id = source,
        channel = "me",
        screenshot = false
    })
end)

Using the export for two players!

player_2_id will be a server variable that is the server id of the second player
Keep in mind these might also change depending on the framework

RegisterCommand("mention", function(source, args, rawCommand)
    TriggerClientEvent('chatMessage', -1, "Mention | " .. GetPlayerName(args[1]), { 201, 201, 201 })
    exports.JD_logsV3:createLog({
        EmbedMessage = "Mention | " .. GetPlayerName(args[1]),
        player_id = source,
        player_2_id = args[1],
        channel = "mention",
        screenshot = false
    })
end)