From d21a48e2a148ce66383514902f981e038a5d04c6 Mon Sep 17 00:00:00 2001 From: Jaime Daniel Date: Mon, 14 Dec 2020 00:53:38 -0300 Subject: [PATCH] Update README --- README.md | 33 ++++++++++++++++++++------------- README.pt.md | 25 ++++++++++++++++--------- 2 files changed, 36 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index a6078ad..3d08d7e 100644 --- a/README.md +++ b/README.md @@ -11,13 +11,17 @@ > You can also read this in [Portuguese](https://github.com/jaimeadf/discord-screenshot/blob/master/README.pt.md). -`discord-screenshot` is a resource for [FiveM](https://fivem.net) that capture the screen of a player and upload it to a discord's webhook. +`discord-screenshot` is a resource for [FiveM](https://fivem.net) that captures the screen of a player and uploads it to +a discord's webhook. [![Showcase](https://yt-embed.herokuapp.com/embed?v=c9h40LoLky8)](https://youtu.be/c9h40LoLky8) ## Installation -1. Make sure your artifacts ([windows](https://runtime.fivem.net/artifacts/fivem/build_server_windows/master) or [linux](https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master)) are up to date. -2. Extract the latest zip file at [releases](https://github.com/jaimeadf/discord-screenshot/releases) in your resources folder. + +1. Make sure your artifacts ([windows](https://runtime.fivem.net/artifacts/fivem/build_server_windows/master) + or [linux](https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master)) are up to date. +2. Extract the latest zip file at [releases](https://github.com/jaimeadf/discord-screenshot/releases) in your resources + folder. 3. Add `ensure screenshot-basic` and `ensure discord-screenshot` in your `server.cfg`. 4. Adjust the [configuration](#configuration) of the resource in the `settings.json`. @@ -28,8 +32,8 @@ * **commandName** - The command name. * **commandPermission** - The permission to use the command. * **screenshotOptions** - * **encoding** - The file format (`png`, `jpg` or `webp`) - * **quality** - The image quality from 0.0 to 1.0. + * **encoding** - The file format (`png`, `jpg` or `webp`) + * **quality** - The image quality from 0.0 to 1.0. ## Default usage @@ -37,7 +41,7 @@ ### Standalone -#### /screenshot <player ou identifier> +#### /screenshot <player or identifier> Can be used via the server console or by anyone with the ace permission `command.screenshot`. @@ -53,14 +57,16 @@ Can be used via the server console or by anyone with the permission `command.scr #### requestClientScreenshotUploadToDiscord -Capture the screen of the player and send it to the configured discord webhook. +Captures the screen of the player and sends it to the configured discord's webhook. Parameters: + * **player**: string | number * **webhookMessageData?**: [WebhookMessageData](https://birdie0.github.io/discord-webhooks-guide/discord_webhook.html) * **callback?**: (error?: string) => void Example: + ```lua exports["discord-screenshot"]:requestClientScreenshotUploadToDiscord( GetPlayers()[1], @@ -81,28 +87,29 @@ exports["discord-screenshot"]:requestClientScreenshotUploadToDiscord( }, function(error) if error then - return print(error) + return print("^1ERROR: " .. error) end print("Sent screenshot successfully") end ) - ``` #### requestCustomClientScreenshotUploadToDiscord -Capture the screen of the player and send it to the specified discord webhook. +Captures the screen of the player and sends it to the specified discord's webhook. Parameters: + * **player**: string | number * **webhookUrl**: string * **options?**: object - * **encoding**: 'png' | 'jpg' | 'webp' - * **quality**: number + * **encoding**: 'png' | 'jpg' | 'webp' + * **quality**: number * **webhookMessageData?**: [WebhookMessageData](https://birdie0.github.io/discord-webhooks-guide/discord_webhook.html) * **callback?**: (error?: string) => void Example: + ```lua exports["discord-screenshot"]:requestCustomClientScreenshotUploadToDiscord( GetPlayers()[1], @@ -128,7 +135,7 @@ exports["discord-screenshot"]:requestCustomClientScreenshotUploadToDiscord( }, function(error) if error then - return print("^7" .. error) + return print("^1ERROR: " .. error) end print("Sent screenshot successfully") end diff --git a/README.pt.md b/README.pt.md index 105ef7f..90b7d36 100644 --- a/README.pt.md +++ b/README.pt.md @@ -9,13 +9,17 @@

-`discord-screenshot` é um resource para [FiveM](https://fivem.net) que captura a tela de um player e a upa para o webhook do discord. +`discord-screenshot` é um resource para [FiveM](https://fivem.net) que captura a tela de um player e a upa para o +webhook do discord. [![Showcase](https://yt-embed.herokuapp.com/embed?v=c9h40LoLky8)](https://youtu.be/c9h40LoLky8) ## Instalação -1. Certifique-se que seus artefatos ([windows](https://runtime.fivem.net/artifacts/fivem/build_server_windows/master) ou [linux](https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master)) estão atualizados. -2. Extraia o último arquivo zip em [releases](https://github.com/jaimeadf/discord-screenshot/releases) na sua pasta resources. + +1. Certifique-se que seus artefatos ([windows](https://runtime.fivem.net/artifacts/fivem/build_server_windows/master) + ou [linux](https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master)) estão atualizados. +2. Extraia o último arquivo zip em [releases](https://github.com/jaimeadf/discord-screenshot/releases) na sua pasta + resources. 3. Adicione `ensure screenshot-basic` e `ensure discord-screenshot` no seu `server.cfg`. 4. Ajuste a [configuração](#configuração) do resource no `settings.json`. @@ -26,8 +30,8 @@ * **commandName** - O nome do comando. * **commandPermission** - A permissão para usar o comando. * **screenshotOptions** - * **encoding** - O formato do arquivo (`png`, `jpg` ou `webp`) - * **quality** - A qualidade da imagem de 0.0 a 1.0. + * **encoding** - O formato do arquivo (`png`, `jpg` ou `webp`) + * **quality** - A qualidade da imagem de 0.0 a 1.0. ## Uso padrão @@ -54,11 +58,13 @@ Pode ser usado pelo console do servidor ou por qualquer um com a permissão `com Captura a tela do player e a envia para o webhook do discord configurado. Parâmetros: + * **player**: string | number * **webhookMessageData?**: [WebhookMessageData](https://birdie0.github.io/discord-webhooks-guide/discord_webhook.html) * **callback?**: (error?: string) => void Exemplo: + ```lua exports["discord-screenshot"]:requestClientScreenshotUploadToDiscord( GetPlayers()[1], @@ -84,7 +90,6 @@ exports["discord-screenshot"]:requestClientScreenshotUploadToDiscord( print("Sent screenshot successfully") end ) - ``` #### requestCustomClientScreenshotUploadToDiscord @@ -92,15 +97,17 @@ exports["discord-screenshot"]:requestClientScreenshotUploadToDiscord( Captura a tela do player e a envia para o webhook do discord especificado. Parâmetros: + * **player**: string | number * **webhookUrl**: string * **options?**: object - * **encoding**: 'png' | 'jpg' | 'webp' - * **quality**: number + * **encoding**: 'png' | 'jpg' | 'webp' + * **quality**: number * **webhookMessageData?**: [WebhookMessageData](https://birdie0.github.io/discord-webhooks-guide/discord_webhook.html) * **callback?**: (error?: string) => void Exemplo: + ```lua exports["discord-screenshot"]:requestCustomClientScreenshotUploadToDiscord( GetPlayers()[1], @@ -126,7 +133,7 @@ exports["discord-screenshot"]:requestCustomClientScreenshotUploadToDiscord( }, function(error) if error then - return print(error) + return print("^1ERROR: " .. error) end print("Sent screenshot successfully") end