Skip to content

Screenshots the player face/mugshot and returns an image url

Notifications You must be signed in to change notification settings

jonassvensson4/mugshot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

mugshot

This will upload a screenshot of your own ped (face/mugshot) and return the image url. This is a client-sided function.

Installation

  1. Install my modified screenshot-basic resource.
  2. Add start mugshotto your server.cfg.
    Remember to start it after screenshot-basic and before your scripts that are using the export.
  3. This resource uploads images to imgur, you'll need to create a client and add your client ID to the top of the client.js. You can create a client here: https://api.imgur.com/oauth2/addclient

JavaScript example

exports['mugshot'].getMugshotUrl(PlayerPedId(), ( url ) => {
    emit('chat:addMessage', {
        template: '<img src="{0}" style="width: 160px; height: 170px;" />',
        args: [url]
    });
});

LUA example

exports['mugshot']:getMugshotUrl(PlayerPedId(), function ( url )
    TriggerEvent('chat:addMessage', {
        template = '<img src="{0}" style="width: 160px; height: 170px;" />',
        args = {url}
    })
end)

About

Screenshots the player face/mugshot and returns an image url

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published