İDCARD
ES-IDCARD is a comprehensive identity card system for FiveM QBCore and ESX servers. It allows players to view, share, and create various types of identification cards including ID cards, driver's lice
Dependencies
ox_lib
loaf_headshot_base64
Installation
Download the resource
Place it in your server's resources folder
Ensure dependencies are installed (
ox_lib
andloaf_headshot_base64
)Add the following to your server.cfg:
ensure ox_lib ensure loaf_headshot_base64 ensure es-idcard
Items Setup
Add the following items to your server's shared items file:
For QBCore (qb-core/shared/items.lua
):
["id_card"] = {
["name"] = "id_card",
["label"] = "ID Card",
["weight"] = 0,
["type"] = "item",
["image"] = "id_card.png",
["unique"] = false,
["useable"] = true,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "ID Card"
},
["driver_license"] = {
["name"] = "driver_license",
["label"] = "Driver License",
["weight"] = 0,
["type"] = "item",
["image"] = "driver_license.png",
["unique"] = false,
["useable"] = true,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "Driver License"
},
["weaponlicense"] = {
["name"] = "weaponlicense",
["label"] = "Weapon License",
["weight"] = 0,
["type"] = "item",
["image"] = "weapon_license.png",
["unique"] = false,
["useable"] = true,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "Weapon License"
},
["fake_idcard"] = {
["name"] = "fake_idcard",
["label"] = "Fake ID Card",
["weight"] = 0,
["type"] = "item",
["image"] = "id_card.png",
["unique"] = false,
["useable"] = true,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "Fake ID Card"
},
["job_card"] = {
["name"] = "job_card",
["label"] = "Job Card",
["weight"] = 0,
["type"] = "item",
["image"] = "job_card.png",
["unique"] = false,
["useable"] = true,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "Job Card"
}
For ESX, add similar items to your ESX items database or configuration.
Configuration Files
You can modify the script settings in shared/cfg.lua
:
Card types and their appearances
Location coordinates for ID card creation
Prices for licenses
Animation settings
And more
For Discord avatar integration, set your Discord bot token in shared/server_config.lua
:
Config = {
PhotoType = "discord", -- or "steam"
NoImage = "https://your-default-image.png",
DiscordBotToken = "YOUR_DISCORD_BOT_TOKEN",
}
Usage
For Players
Viewing ID Cards: Use your ID card from inventory to display it
Sharing ID Cards: When displaying your card, nearby players will automatically see it
Creating ID Cards: Visit the City Hall location to purchase new ID cards
Creating Fake ID Cards: Visit the fake ID card location to create fake identity cards
For Developers
The script provides several exports for integration with other resources:
-- Give a player a driver's license
exports["es-idcard"]:GivePlayerDriverLicense(playerId)
-- Give a player a weapon license
exports["es-idcard"]:GivePlayerWeaponLicense(playerId)
-- Check if a player has a driver's license
local hasLicense = exports["es-idcard"]:GetPlayerDriverLicense(playerId)
-- Check if a player has a weapon license
local hasLicense = exports["es-idcard"]:GetPlayerWeaponLicense(playerId)
Customizing Card Types
You can add new card types or modify existing ones in shared/cfg.lua
:
CardTypes = {
my_custom_card = {
Type = "My Custom Card",
FirstColor = "#FF5733",
SecondColor = "#FF5733",
Logo = "custom_logo.png",
CardDescription = "Description of your custom card"
},
}
Last updated