QBCore Integration
This guide documents the installation for our Drivingschool with full QB City Hall integration.
File Modificationsβ
1οΈ. qb-core/shared/items.lua
β
Add the following items under qb-core > shared > items
:
drive_truck = { name = 'drive_truck', label = 'Trucker License', weight = 0, type = 'item', image = 'driver_license.png', unique = true, useable = true, shouldClose = true, description = '' },
drive_bus = { name = 'drive_bus', label = 'Bus License', weight = 0, type = 'item', image = 'driver_license.png', unique = true, useable = true, shouldClose = true, description = '' },
drive_boat = { name = 'drive_boat', label = 'Boat License', weight = 0, type = 'item', image = 'driver_license.png', unique = true, useable = true, shouldClose = true, description = '' },
drive_bike = { name = 'drive_bike', label = 'Bike License', weight = 0, type = 'item', image = 'driver_license.png', unique = true, useable = true, shouldClose = true, description = '' },
drive_plane = { name = 'drive_plane', label = 'Plane License', weight = 0, type = 'item', image = 'driver_license.png', unique = true, useable = true, shouldClose = true, description = '' },
2. qb-cityhall/config.lua
β
Update or insert the following license configurations under licenses
:
licenses = {
['id_card'] = {
label = 'ID Card',
cost = 10,
},
['driver_license'] = {
label = 'Driver License',
cost = 50,
metadata = 'driver'
},
['drive_truck'] = {
label = 'Trucker License',
cost = 500,
metadata = 'drive_truck'
},
['drive_bus'] = {
label = 'Bus Driver License',
cost = 250,
metadata = 'drive_bus'
},
['drive_boat'] = {
label = 'Boat License',
cost = 350,
metadata = 'drive_boat'
},
['drive_bike'] = {
label = 'Class 6A Bike License',
cost = 50,
metadata = 'drive_bike'
},
['drive_plane'] = {
label = 'Pilot License',
cost = 3000,
metadata = 'drive_plane'
},
['weaponlicense'] = {
label = 'Weapon License',
cost = 50,
metadata = 'weapon'
},
}
3. qb-cityhall/server/main.lua
β
Inside the license creation logic, add handling for each license type:
elseif item == 'drive_truck' then
info.firstname = Player.PlayerData.charinfo.firstname
info.lastname = Player.PlayerData.charinfo.lastname
info.birthdate = Player.PlayerData.charinfo.birthdate
info.type = 'Class 1 Trucker License'
elseif item == 'drive_bus' then
info.firstname = Player.PlayerData.charinfo.firstname
info.lastname = Player.PlayerData.charinfo.lastname
info.birthdate = Player.PlayerData.charinfo.birthdate
info.type = 'Bus Driver License'
elseif item == 'drive_boat' then
info.firstname = Player.PlayerData.charinfo.firstname
info.lastname = Player.PlayerData.charinfo.lastname
info.birthdate = Player.PlayerData.charinfo.birthdate
info.type = 'Boat License'
elseif item == 'drive_bike' then
info.firstname = Player.PlayerData.charinfo.firstname
info.lastname = Player.PlayerData.charinfo.lastname
info.birthdate = Player.PlayerData.charinfo.birthdate
info.type = 'Class 6A Bike License'
elseif item == 'drive_plane' then
info.firstname = Player.PlayerData.charinfo.firstname
info.lastname = Player.PlayerData.charinfo.lastname
info.birthdate = Player.PlayerData.charinfo.birthdate
info.type = 'Pilot License'