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.
In Game
uninstall
config.json
ensure JD_logsV3
!jdlogs setup
.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"]
}
}
}
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
!jdlogs create
command.
channels.json
This can also be the channel id or a webhook url.Since making custom logs are depending on what you want to logs i can not give any examples other than some standalone commands.
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)
EmbedMessage: This will be the /tweet message in this case
player_id: Since there is no players we have removed it
player_2_id: Since there is no players we have removed it
color: This can be any color you want
channel: This will be linked to the channel in the config.
player_id: is the variable that is used for getting the player info.
player_2_id: isn’t used and therefore we can remove it from the export.
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)
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)