Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimeadf committed Dec 14, 2020
1 parent 54a5453 commit d21a48e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 22 deletions.
33 changes: 20 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand All @@ -28,16 +32,16 @@
* **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

> **Note:** If you pass `-1` as target, the screen of all the players will be captured.
### 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`.

Expand All @@ -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],
Expand All @@ -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],
Expand All @@ -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
Expand Down
25 changes: 16 additions & 9 deletions README.pt.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@
</a>
</p>

`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`.

Expand All @@ -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

Expand All @@ -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],
Expand All @@ -84,23 +90,24 @@ exports["discord-screenshot"]:requestClientScreenshotUploadToDiscord(
print("Sent screenshot successfully")
end
)

```

#### requestCustomClientScreenshotUploadToDiscord

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],
Expand All @@ -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
Expand Down

0 comments on commit d21a48e

Please sign in to comment.