[RELEASE] MugShotBase64

Hello FiveM Community.

A script can convert peds mugshot image to Base64 encoding to save that as save and manage that

Features

  • Can cache image as text anywhere (JSON, SQL, TXT)
  • No need to upload anywhere
  • So fast don’t need to wait much to get that
  • Standalone it doesn’t use any function from anywhere
  • Can make a mugshot from any ped, not just self player
  • Optimize and get low usage (0.00 on idle and 0.01 on converting)
  • Clean coding

Resource preview



Video

Requirements

  • Brain

Github

Download & Installation

Installation

  • Add this in your server.cfg in the following order:
start MugShotBase64

Exports

Client

Export Description Parameter(s) Return type
GetMugShotBase64 Returns base64 string Ped Hanel, bool(Transpert) string

Credits

22 Likes

I recall seeing if something like this was around a long while ago…

Great work.
Will be useful for a great many of us.

1 Like

genius!

1 Like

Beautiful code, great work!

1 Like

How do I use export from another resource?

1 Like

If I store this Base64 string for every player in Database, then retrieve it for ex. phone or mdt, how can I convert this String back to picture?

1 Like

It’s not hard to litterally use google.

Its the src= within html.

1 Like
local MugShot = exports["MugShotBase64"]:GetMugShotBase64(GetPlayerPed(-1), false)

I wanted to tell from the server how to get it, I already figured it out

local photo = exports["MugShotBase64"]:GetMugShotBase64(PlayerPedId(), true)
			--print(photo)
			TriggerServerEvent('fivem-appearance:save', appearance, photo)

I try to save a photo when a player creates or changes his character.

1 Like

This should be a requirement for all script releases!

2 Likes

fact :joy:

2 Likes

Great work @BaziForYou

1 Like

Amazing job! Thanks for the release

1 Like

Questions:How you find that https://nui-img/ feature…? I found not any informations about that in google.

1 Like

hi I found in GitHub in one script cant remember the name but just need to search in GitHub like:

this is amazing , keep up the good work :3

1 Like

Hello friend.
Many Thanks for this awsome job.
How can i request shot from another player ? From client side of course.

Thank you so much

if you want all in client you can do like this

local PlayerId = 2
local Answer = {Got = false,Answer = ""}
for _, i in ipairs(GetActivePlayers()) do
	if NetworkIsPlayerActive(i) and tonumber(GetPlayerServerId(i)) == tonumber(PlayerId) then
		local Ped = GetPlayerPed(i)
		Answer.Answer = exports["MugShotBase64"]:GetMugShotBase64(Ped, false)
		Answer.Got = true
		break
	end
end
1 Like

Is there a way to do it with server side?

i want to do it like that if possible.

QBCore.Functions.CreateCallback('qb-phone:server:GetPlayerInfo', function(source, cb)
    local Playerinfo = {}
    local Player = QBCore.Functions.GetPlayer(source)
    Playerinfo = {
        name = Player.PlayerData.charinfo.firstname .. " " .. Player.PlayerData.charinfo.lastname,
        phone = Player.PlayerData.charinfo.phone,
        typejob = Player.PlayerData.job.name,
        mugshot= {mugshothere}
    }
    cb(Playerinfo)
end)