Installation
Last updated
Last updated
exports['shx-idcard']:CreateCard('id_card')
exports['shx-idcard']:CreateCard('driver_license')
exports['shx-idcard']:CreateCard('weapon_license')
exports['shx-idcard']:CreateCard('police_badge')
exports['shx-idcard']:CreateCard('ems_badge')
RegisterCommand("test982", function()
exports['shx-idcard']:CreateCard('id_card')
exports['shx-idcard']:CreateCard('driver_license')
exports['shx-idcard']:CreateCard('weapon_license')
exports['shx-idcard']:CreateCard('police_badge')
exports['shx-idcard']:CreateCard('ems_badge')
end)
Config = {}
Config.Framework = "qbox" -- "qbcore" or "esx" or "qbox"
Config.Inventory = "ox_inventory" -- "qb_inventory" or "qs_inventory" or "ox_inventory"
Config.UseTarget = "ox_target" -- "qb_target" or "ox_target" or "q_target"
Config.oxlibRequire = true -- ox_lib support true or false
Config.MenuType = "ox_lib" -- ox_lib = support true | qb_menu = qb-menu supoort
Config.PedShow = true -- Ped Show true or false hidden
Config.PedLocation = vector4(-545.24, -203.87, 38.22, 207.5) -- Ped Location and Target Location
Config.PedModel = "a_m_y_stwhi_01" -- Ped Model
Config.LicenseList = {
{ event = 'shx-idcard:client:buyIDCard', label = 'ID Card', price = 100, image = "https://cdn.discordapp.com/attachments/247367407864119306/1153712058618105936/id_card.png", qbmenuicon = "fa-solid fa-handcuffs"},
{ event = 'shx-idcard:client:buyWeaponLicense', label = 'Weapon License', price = 1000, image = "https://cdn.discordapp.com/attachments/247367407864119306/1153712057162682541/weaponlicense.png", qbmenuicon = "fa-solid fa-handcuffs"},
{ event = 'shx-idcard:client:buyDriverLicense', label = 'Driver License', price = 1000, image = "https://cdn.discordapp.com/attachments/247367407864119306/1153712057573703801/driverlicense.png", qbmenuicon = "fa-solid fa-handcuffs"},
{ event = 'shx-idcard:client:buyPDBadge', label = 'PD Badge', price = 500, job = "police", image = 'https://cdn.discordapp.com/attachments/247367407864119306/1153712059079458826/pdbadge.png', qbmenuicon = "fa-solid fa-handcuffs"},
{ event = 'shx-idcard:client:buyEMSBadge', label = 'EMS Badge', price = 500, job = "ambulance", image = 'https://cdn.discordapp.com/attachments/247367407864119306/1153712058135748628/ems_badge_empty.png', qbmenuicon = "fa-solid fa-handcuffs"},
}
Config.Target = { -- Target Icon and Label
MenuTarget = {label = 'Talk', icon = 'fa-regular fa-comment-dots'},
}
Config.Genders = {
male = "Male", -- Male
female = "Female" -- Female
}
Note : /giveitem ID id_card 1
Don't use giveitem for cards, use this instead
You also need to add the item to ox_inventory. To do this, navigate to ox_inventory/data/items.lua
and modify it to look like this:
['id_card'] = {
label = 'ID Card',
weight = 1,
close = true,
stack = false,
consume = 0
},
['police_badge'] = {
label = 'Police Badge',
weight = 1,
close = true,
stack = false,
consume = 0
},
['ems_badge'] = {
label = 'EMS Badge',
weight = 1,
close = true,
stack = false,
consume = 0
},
['driver_license'] = {
label = 'Driver License',
weight = 1,
close = true,
stack = false,
consume = 0
},
['weaponlicense'] = {
label = 'Weapon License',
weight = 1,
close = true,
stack = false,
consume = 0
},
You also need to add the item usable to ox_inventory. To do this, navigate to ox_inventory/modules/items/client.lua
and modify it to look like this:
Item('id_card', function(data, slot)
TriggerEvent('shx-idcard:client:showId', slot.metadata)
end)
Item('police_badge', function(data, slot)
TriggerEvent('shx-idcard:client:showPoliceBadge', slot.metadata)
end)
Item('ems_badge', function(data, slot)
TriggerEvent('shx-idcard:client:showEMSBadge', slot.metadata)
end)
Item('driver_license', function(data, slot)
TriggerEvent('shx-idcard:client:showDriverLicense', slot.metadata)
end)
Item('weaponlicense', function(data, slot)
TriggerEvent('shx-idcard:client:showWeaponLicense', slot.metadata)
end)
Go to qb-inventory/js/app.js
and find the function function FormatItemInfo(itemData) {
, by default at line 384. After if (itemData != null && itemData.info != "") {
, add the following code:
if (itemData.name == "id_card") {
$(".item-info-title").html("<p>" + itemData.label + "</p>");
$(".item-info-description").html(
"</span></p><p><strong>Firstname: </strong><span>" +
itemData.info.firstname +
"</span></p><p><strong>Lastname: </strong><span>" +
itemData.info.lastname +
"</span></p><p><strong>Date Of Birth: </strong><span>" +
itemData.info.birthdate +
"</span></p><p><strong>Gender: </strong><span>" +
gender +
"</span></p>"
);
} else if (itemData.name == "ems_badge") {
$(".item-info-title").html("<p>" + itemData.label + "</p>");
$(".item-info-description").html(
"<p><strong>Firstname: </strong><span>" +
itemData.info.firstname +
"</span></p><p><strong>Lastname: </strong><span>" +
itemData.info.lastname +
"</span></p>"
);
} else if (itemData.name == "police_badge") {
$(".item-info-title").html("<p>" + itemData.label + "</p>");
$(".item-info-description").html(
"<p><strong>Firstname: </strong><span>" +
itemData.info.firstname +
"</span></p><p><strong>Lastname: </strong><span>" +
itemData.info.lastname +
"</span></p>"
);
} else if (itemData.name == "driver_license") {
$(".item-info-title").html("<p>" + itemData.label + "</p>");
$(".item-info-description").html(
"</span></p><p><strong>Firstname: </strong><span>" +
itemData.info.firstname +
"</span></p><p><strong>Lastname: </strong><span>" +
itemData.info.lastname +
"</span></p><p><strong>Date Of Birth: </strong><span>" +
itemData.info.birthdate +
"</span></p><p><strong>Gender: </strong><span>" +
gender +
"</span></p>"
);
} else if (itemData.name == "weaponlicense") {
$(".item-info-title").html("<p>" + itemData.label + "</p>");
$(".item-info-description").html(
"</span></p><p><strong>Firstname: </strong><span>" +
itemData.info.firstname +
"</span></p><p><strong>Lastname: </strong><span>" +
itemData.info.lastname +
"</span></p><p><strong>Date Of Birth: </strong><span>" +
itemData.info.birthdate +
"</span></p><p><strong>Gender: </strong><span>" +
gender +
"</span></p>"
);
Go to qb-core/shared/items.lua
, add the following code:
['id_card'] = {['name'] = 'id_card', ['label'] = 'ID Card', ['weight'] = 100, ['type'] = 'item', ['image'] = 'id_card.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'ID Card'},
['police_badge'] = {['name'] = 'police_badge', ['label'] = 'Police Badge', ['weight'] = 100, ['type'] = 'item', ['image'] = 'police_badge.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Police Badge'},
['ems_badge'] = {['name'] = 'ems_badge', ['label'] = 'EMS Badge', ['weight'] = 100, ['type'] = 'item', ['image'] = 'ems_badge.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'EMS Badge'},
['driver_license'] = {['name'] = 'driver_license', ['label'] = 'Driver License', ['weight'] = 100, ['type'] = 'item', ['image'] = 'ems_badge.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Weapon License'},
['weaponlicense'] = {['name'] = 'weaponlicense', ['label'] = 'Weapon License', ['weight'] = 100, ['type'] = 'item', ['image'] = 'ems_badge.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Driver License'},
Add qs-inventory/config/config_metadata.js
if (itemData.name == "id_card") {
$(".item-info-title").html("<p>" + itemData.label + "</p>");
$(".item-info-description").html(
"</span></p><p><strong>Firstname: </strong><span>" +
itemData.info.firstname +
"</span></p><p><strong>Lastname: </strong><span>" +
itemData.info.lastname +
"</span></p><p><strong>Date Of Birth: </strong><span>" +
itemData.info.birthdate +
"</span></p><p><strong>Gender: </strong><span>" +
gender +
"</span></p>"
);
} else if (itemData.name == "ems_badge") {
$(".item-info-title").html("<p>" + itemData.label + "</p>");
$(".item-info-description").html(
"<p><strong>Firstname: </strong><span>" +
itemData.info.firstname +
"</span></p><p><strong>Lastname: </strong><span>" +
itemData.info.lastname +
"</span></p>"
);
} else if (itemData.name == "police_badge") {
$(".item-info-title").html("<p>" + itemData.label + "</p>");
$(".item-info-description").html(
"<p><strong>Firstname: </strong><span>" +
itemData.info.firstname +
"</span></p><p><strong>Lastname: </strong><span>" +
itemData.info.lastname +
"</span></p>"
);
} else if (itemData.name == "driver_license") {
$(".item-info-title").html("<p>" + itemData.label + "</p>");
$(".item-info-description").html(
"</span></p><p><strong>Firstname: </strong><span>" +
itemData.info.firstname +
"</span></p><p><strong>Lastname: </strong><span>" +
itemData.info.lastname +
"</span></p><p><strong>Date Of Birth: </strong><span>" +
itemData.info.birthdate +
"</span></p><p><strong>Gender: </strong><span>" +
gender +
"</span></p>"
);
} else if (itemData.name == "weaponlicense") {
$(".item-info-title").html("<p>" + itemData.label + "</p>");
$(".item-info-description").html(
"</span></p><p><strong>Firstname: </strong><span>" +
itemData.info.firstname +
"</span></p><p><strong>Lastname: </strong><span>" +
itemData.info.lastname +
"</span></p><p><strong>Date Of Birth: </strong><span>" +
itemData.info.birthdate +
"</span></p><p><strong>Gender: </strong><span>" +
gender +
"</span></p>"
);
Go to qs-inventory/config/config_items.lua
['police_badge'] = {
['name'] = 'police_badge',
['label'] = 'Police Badge',
['weight'] = 200,
['type'] = 'item',
['image'] = 'police_badge.png',
['unique'] = true,
['useable'] = true,
['shouldClose'] = true,
['combinable'] = nil,
['description'] = 'Badge',
},
['id_card'] = {
['name'] = 'id_card',
['label'] = 'ID Card',
['weight'] = 200,
['type'] = 'item',
['image'] = 'id_card.png',
['unique'] = true,
['useable'] = true,
['shouldClose'] = true,
['combinable'] = nil,
['description'] = 'ID Card',
},
['ems_badge'] = {
['name'] = 'ems_badge',
['label'] = 'EMS Badge',
['weight'] = 200,
['type'] = 'item',
['image'] = 'ems_badge.png',
['unique'] = true,
['useable'] = true,
['shouldClose'] = true,
['combinable'] = nil,
['description'] = 'Badge',
},
['weaponlicense'] = {
['name'] = 'weaponlicense',
['label'] = 'Weapon License',
['weight'] = 200,
['type'] = 'item',
['image'] = 'weaponlicense.png',
['unique'] = true,
['useable'] = true,
['shouldClose'] = true,
['combinable'] = nil,
['description'] = 'Badge',
},
['driver_license'] = {
['name'] = 'driver_license',
['label'] = 'Driver License',
['weight'] = 200,
['type'] = 'item',
['image'] = 'driver_license.png',
['unique'] = true,
['useable'] = true,
['shouldClose'] = true,
['combinable'] = nil,
['description'] = 'Badge',
},