[Release] [Dev Resource] Licenses & Id Cards

Licenses

driver license_imgur

About

Licenses is a small dev resource, which means that it does almost nothing by itself, and you’ll have to add some functionality to it. The background images are based on the state of California driver’s license.

I originally made this a while back (roughly 2 years ago) and it sadly never got to be used. (Some of the code has been reworked more recently.)

For more information on how to use it read the README.md on github.
Note: The html/css is not responsive, but feel free to contribute if you decide to fix it yourself.

Download

Github
Direct download: licenses.zip (1.3 MB)

Some of my other scripts
[Release] Telescopes
[Standalone] [PAID] Slash Tires

8 Likes

I want use it with jsfour-idcard, is possible?

Sure, you would have to set it up yourself, but it shouldn’t be too hard. Just make sure you input the right data when using an export/triggering an event.

Ohh full qb meta data code started now :smiley:

is ESX?

It is standalone, so no esx. But you can make it work with esx.

1 Like

This is super nice! May end up contributing soon whenever I do get on my main computer. Great work though from what I see. :slight_smile: <3

2 Likes

how do u look at ur id or driver licenses ingame

how do u edit it tho

how do u edit ur name?

1 Like

Here is the information on how to use it: README.md (github)
Here is the example that is included: example.lua (github)

This is a dev resource, aka it does nothing by itself.

Here is another example using the QB framework since I presume a lot of people are using that (server-side):

local QBCore = exports['qb-core']:GetCoreObject()

RegisterCommand("showid", function(source, args, rawCommand)
    if (source > 0) then
        local Player = QBCore.Functions.GetPlayer(source)
        local data = {
            FirstName = Player.PlayerData.charinfo.firstname,
            LastName = Player.PlayerData.charinfo.lastname,
            DOB = Player.PlayerData.charinfo.birthdate,
            Issue = os.date("%x"),
            CitizenID = Player.PlayerData.citizenid,
            Sex = Player.PlayerData.charinfo.gender,
            Hair = "-",
            Height = "-",
            Eyes = "-",
            Image = "images/placeholder.png",
            Format = "id"
        }
        TriggerClientEvent('licenses:showToClosest', source, data)
    end
end, false)

--Note: I haven't tested the code above as I don't use qb core, but it should work as far as I know.

This is just one way of doing it with QB, you can do it differently (using item metadata for example) or adapt it to any other framework.

hi can you set a command where we can register our own names
for ex /setid John Doe 2/22/1999

This is a dev resource, you are supposed to add the functionality yourself, but here is an example:

add this to server.lua:

local characters = {}

RegisterCommand("setid", function(source, args, rawCommand)
    if (source > 0) then
		local data = {
            FirstName = args[1] or (characters[source] and characters[source].FirstName) or "John",
            LastName = args[2] or (characters[source] and characters[source].LastName) or "Doe",
            DOB = args[3] or (characters[source] and characters[source].DOB) or "2/22/1999",
            Issue = os.date("%x"),
            CitizenID = "-",
            Sex = "-",
            Hair = "-",
            Height = "-",
            Eyes = "-",
            Image = "images/placeholder.png",
            Format = "id"
        }
		characters[source] = data
		TriggerClientEvent('chat:addMessage', source, { args = { 'ID: ', "You succesfully set your id to: "..data.FirstName.." "..data.LastName..", "..data.DOB } })
    else
        print("setid command was executed by the server console, RCON client, or a resource, this should not happen.")
    end
end, false)

RegisterCommand("showid", function(source, args, rawCommand)
    if (source > 0) then
		if characters[source] then
        	TriggerClientEvent('licenses:showToClosest', source, characters[source])
		else
			TriggerClientEvent('chat:addMessage', source, { args = { 'ID: ', "You haven't set your id, use /setid first!" } })
		end
    else
        print("showid command was executed by the server console, RCON client, or a resource, this should not happen.")
    end
end, false)

and this to client.lua if you wish to give them some help:

TriggerEvent('chat:addSuggestion', '/setid', "sets your id", {
    { name="Firstname", help="The first name of your character", },
    { name="Lastname", help="The last name of your character", },
    { name="DOB", help="Date of Birth", }
})
TriggerEvent('chat:addSuggestion', '/showid', "Shows your id to the closest person, use /setid to set your id.")

Remember to disable the example.lua file if you haven’t as it contains a showid command their aswell. I hope this helped, you can add more arguments if you wish.

You can tell me if these possible to adapt this function instead of the PNG image ESX.Game.GetPedMugshot(PlayerPedId())

Hello,

I’ve seen others do it, however, I’m unsure how it’s done.
This paid script is an example of it:

I make my own code, I’ll try to do it myself :slight_smile:

1 Like