You can also read this in Portuguese.
discord-screenshot
is a resource for FiveM that captures the screen of a player and uploads it to
a discord webhook.
discord-screenshot-x-x-x.zip
) in your resources
folder.ensure screenshot-basic
and ensure discord-screenshot
in your server.cfg
.settings.json
.vrp
or none
).ip
).png
, jpg
or webp
)Note: If you pass
-1
as target, the screen of all the players will be captured.
Can be used via the server console or by anyone with the ace permission request.screenshot
.
Can be used via the server console or by anyone with the permission request.screenshot
.
Captures the screen of the player and sends it to the configured discord's webhook.
Parameters:
Example:
exports["discord-screenshot"]:requestClientScreenshotUploadToDiscord(
GetPlayers()[1],
{
username = "A cat",
avatar_url = "https://cdn2.thecatapi.com/images/IboDUkK8K.jpg",
content = "Meow!",
embeds = {
{
color = 16771584,
author = {
name = "Wow!",
icon_url = "https://cdn.discordapp.com/embed/avatars/0.png"
},
title = "I can send anything."
}
}
},
30000,
function(error)
if error then
return print("^1ERROR: " .. error)
end
print("Sent screenshot successfully")
end
)
Captures the screen of the player and sends it to the specified discord's webhook.
Parameters:
Example:
exports["discord-screenshot"]:requestCustomClientScreenshotUploadToDiscord(
GetPlayers()[1],
"https://ptb.discord.com/api/webhooks/767824413780607097/WLjd77Y0CUvqXmhLCYzqkiZ-BrTpcGfNiZ7hXcJRgQxrU0YR8sy566MgMHgqRx8IZ9iu",
{
encoding = "png",
quality = 1
},
{
username = "A cat",
avatar_url = "https://cdn2.thecatapi.com/images/IboDUkK8K.jpg",
content = "Meow!",
embeds = {
{
color = 16771584,
author = {
name = "Wow!",
icon_url = "https://cdn.discordapp.com/embed/avatars/0.png"
},
title = "I can send anything."
}
}
},
30000,
function(error)
if error then
return print("^1ERROR: " .. error)
end
print("Sent screenshot successfully")
end
)