Giter Site home page Giter Site logo

alp1x / um-idcard Goto Github PK

View Code? Open in Web Editor NEW
175.0 9.0 85.0 2.64 MB

🪪this is a FiveM script that generates identity cards with mugshots and metadata, specifically designed to be compatible with QBCore,ESX,QBox.

License: GNU General Public License v3.0

Lua 65.08% JavaScript 13.74% HTML 8.85% CSS 12.33%
fivem lua qb qbcore esx esx-legacy

um-idcard's Introduction

⚠️ If you are having problems with um-idcard, you can wait for an update or alternatively use the following scripts suggested by um

um-idcard | old (qb-idcard)

qb-idcard has been updated and renamed as um-idcard, and it is now compatible with ESX and QBCore and Qbox

Setup

Usage

  • Just use the item
  • If there is someone near you, it will be visible to them, otherwise only you will see it.
  • It takes a mugshot of you on the first use of the item and saves it in metadata.

How to create a custom identity card?

How can add an identity card with metadata?

Optional

Inventory

Contributors

License

GNU General Public License v3.0

Star History

Star History Chart

um-idcard's People

Contributors

alp1x avatar berkiebb avatar doom-dev avatar duboiss avatar ihyajb avatar kevinalonsoqc avatar lilstzxd avatar manason avatar mockdot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

um-idcard's Issues

qb-cityhall error

No such export CreateMetaLicense in resource um-idcard

Im using qb-core. I have mug shot and um-idcard loaded last. everything is per your qb-core instructions.

[SUGGESTION]

Hey is it possible to implement 2 things

  • ID's to stay on screen for 10seconds instead of until you press backspace
  • Also, for it to show for everyone around instead of the closest person
    At the moment if I use an ID, it shows to the closest person but it doesn't show for me, so I'm not sure if it's used so try an use it again, but it would be nice if it showed for us both and then disappeared after 10seconds

Be able to move when open

Great script! Been looking for something like this for a long time, so thanks for sharing :)

I would love to be able to move when the "id card" is open on your screen.
You can easly missclick your id when your a passanger in the car and the driver cant move befor he hit "esc"
Would love to see a change for this :)

no card type

when i want to open the id it show in the f8 error No Card Type
dss

Info not showing on bought cards

I added the items to a qb-shop and after buying it the card won't show the details, however, if it is spawned by an admin it does show the details.

There's actually no item policecard.

Idk where to find this policecard item... It's not in any of the lua files, config, readme, manifest and it's not on the github so where do I find it?

can you look into ps-inventory

i tried with ps-inventory but got the error SCRIPT ERROR: @um-idcard/main/server.lua:17: attempt to call a nil value (global 'NewMetaDataLicense')
I did as the document to ensure an um-id card at last but getting errors

up mugshot esx suggestion

image

bridge > framework > esx.lua

--- Create metadata for license
---@param src number Source number
---@param itemTable string | table Item name or table of item names
local function CreateMetaLicense(src, itemTable)
    local xPlayer = ESX.GetPlayerFromId(src)

    if type(itemTable) == "string" then
        itemTable = {itemTable}
    end

    if type(itemTable) == "table" then
        for _, v in pairs(itemTable) do
            local mugshot, mugshotStr = ESX.Game.GetPedMugshot(GetPlayerPed(src))
            metadata = {
                cardtype = v,
                identifier = xPlayer.getIdentifier(),
                firstname = xPlayer.variables.firstName,
                lastname = xPlayer.variables.lastName,
                birthdate = xPlayer.variables.dateofbirth,
                sex = xPlayer.variables.sex,
                nationality = 'Los Santos',
                mugShot = mugshotStr,
                badge = GetBadge(src, v)
            }
            exports.ox_inventory:AddItem(src, v, 1, metadata)
            UnregisterPedheadshot(mugshot) -- Make sure to unregister the mugshot to avoid exceeding the limit
        end
    else
        print("Invalid parameter type")
    end
end

exports('CreateMetaLicense', CreateMetaLicense)

main > client.lua

 -- Détection de ESX
local mugshotModule = exports['MugShotBase64']
local usingESX = ESX ~= nil

-- Fonction pour obtenir la mugshot en utilisant ESX.Game.GetPedMugshot si possible, sinon MugShotBase64:GetMugShotBase64
local function getMugShot()
    if usingESX then
        local ped = GetPlayerPed(-1)
        local mugshot, mugshotStr = ESX.Game.GetPedMugshot(ped)
        UnregisterPedheadshot(mugshot)
        return mugshotStr
    else
        return mugshotModule:GetMugShotBase64(cache.ped, false)
    end
end

-- Enregistrement de la fonction callback
lib.callback.register('um-idcard:client:callBack:getMugShot', function()
    return getMugShot()
end)

Showing ID breaks inventory

Hey, when I show ID to others and then go into the inventory, it breaks it and you can move the mouse and screen. Also can't use Third-eye too..

If that makes sense, any way to fix that?

Metadata on CreateMetaLicense event

Hey,

I'm trying to set this up with our hunting licenses the item requires the "info.expire" and info.created meta data but I can't seem to figure out how to pass this through on the CreateMetaLicense export. Any help would be great

um-idcard/web/js/main.js:53

I gave myself a new item, I already changed the settings as in the manual

No errors in server. only in F8

new character error

image

i got this errors when i make a new character and use my id or driver license but when drop it and buy them from the cityhall it works fine

give card

Hello :) congratulations for your script. I wonder how we receive the identity card and others! I am an admin, so I give myself the item but for a player who does not have permission, how does he receive the card?

Ox_inventory

Please make it compatible with ox_inventory 🙏🏻

Erorr !

When I try to use the Id card i get this in thee console, and also no card is displayed.
The first release version was working fine. But after that i keep getting this :
image

I re-installed from scratch everything. SO i don't know if it's something on my end or your script.

Undefined

Getting this when using the command, getting it from the city hall as well on new character creation.
image

Images not changing

I've tried to change the image on idcard for example putting a line and in game nothing changes, any reason why?

Latest QB with QB-Inventory

Hey, may i get some help?
The Setup in the Wiki is Incorrect or atleast the things i should replace dont make really sense :D

Missing information on the card

In qbcore, your personal identification number appears, and this is an important element, especially when using it in MDT and DNN

test5

ERROR

Hi, i added the resource to my server and setuped for ESX, and this shows me in database when i join.
Snímek obrazovky 2023-04-13 222207

Any ideas how to solve it?

Readme Inventory Replace Line is incorrect

Line 321 of the qb-inventory is not the line i think you want to replace. I tried and it cause a malfunction with my whole inventory and wont open and then doesn't allow me to move. Not sure exactly what line needs to be replaced though.

Info not showing on card unless ID card is opened first...

I've added a new line to the identity cards.

local ShowId = function(source, item, nui)
local found = false
local character = QBCore.Functions.GetPlayer(source)
local PlayerPed = GetPlayerPed(source)
local PlayerCoords = GetEntityCoords(PlayerPed)
local info = {
['name'] = item.info.firstname,
['lastname'] = item.info.lastname,
['gender'] = item.info.gender,
['dob'] = item.info.birthdate,
['nationality'] = item.info.nationality,
['type'] = item.info.type,
['citizenid'] = item.info.citizenid
}
for k, v in pairs(QBCore.Functions.GetPlayers()) do
local TargetPed = GetPlayerPed(v)
local dist = #(PlayerCoords - GetEntityCoords(TargetPed))
if dist < 3.0 and PlayerPed ~= TargetPed then
TriggerClientEvent('QBCore:Notify', source, "You showed your card")
TriggerClientEvent('qb-idcard:client:open', v, info, nui)
found = true
break
end
end
if not found then
TriggerClientEvent('qb-idcard:client:open', source, info, nui)
end
end

It works for the most part - the line I added was ['citizenid'] = item.info.citizenid. It will only show up on the other identity cards IF I open the ID Card first. So it will not show on driver's license, lawyers pass, weapon license, nothing unless ID card is opened first...

Is there a way to get it to show on ALL cards right away?

New version qb-core qb-inventory

Hi all.

qb-core and qb-inventory changed a little bit and there is no more

QBCore.Functions.CreateUseableItem("driver_license", function(source, item)

in che inventory->server so I'm a bit confused on how remove the default CreateUseableItem

Unique id not working.

In the old version of the script, id's were working as unique in qb-inventory and when someone else took our id and used it, my id was displayed when that person showed it. But in the new version (with photo), the original system does not work and when the other party steals and uses our identity, the identity of the person who stole it is visible. How can I fix or fix the problem?
Screenshot_1
Screenshot_2

Use not ox?

Hi. Can i use this with not ox- system? I have basic esx inventory with sql database (items) but i can add a 'driver license' item. Thx. But thanks to you, I got to know the ox system because of your identity card topic, and I can start preparing my server again, which will already work like this with the 3rd eye. And others that I still have no idea what it contains. But first i wanna a driver license item, What I want to get after I got it in driving school. And if I leave it, I can buy another one. That's my plan. I just don't have an ox system.

Add a subcontent to handle multiple Licenses

I suggested that on discord but I think it would be nice to have the possibility to handle multiple sub license under the picture and main infos. Like that you could have a "Driver License" item that hold if the player has "Truck License", "Bike License", etc...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.