ESX.Game.GetPedMugshot

1
local mugshot, mugshotStr = ESX.Game.GetPedMugshot(ped)

This function generates a mugshot of the ped usable in various applications.

Argument

Argument Data Type Optional Default Value Explanation
ped string No - The ped handle

ESX.Game.GetPedMugshot Exemplo

Warning

Be sure to use UnregisterPedheadshot(mugshot) after using it, because the game only allows you 34 mugshots, and you won't be allowed to use mugshot once this limit is reached if you don't unregister it.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
ESX = nil

Citizen.CreateThread(function()
    while ESX == nil do
        TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
        Citizen.Wait(0)
    end

    while true do
        Citizen.Wait(10)

        if IsControlJustReleased(0, 22) then -- Spacebar Key
            notification('Hello')
        end
    end
end)

function notification(msg)
    local mugshot, mugshotStr = ESX.Game.GetPedMugshot(GetPlayerPed(-1))
    ESX.ShowAdvancedNotification('Test', 'Testing!', msg, mugshotStr, 1)
    UnregisterPedheadshot(mugshot)
end

Mugshot Exemplo

Also See

ESX.ShowAdvancedNotification