About qbcore-framework
QBCore Framework Development provides guidelines for building resources with the QBCore Framework. It is aimed at developers and covers player data, callbacks, items, database access, and resource structure.
Key features
- 01QBCore Core Object retrieval
- 02Player data and CitizenID practices
- 03Server-client callback patterns
- 04Usable item registration
- 05Database query patterns
Use cases
- 01Structuring a QBCore resource
- 02Handling player data with server validation
- 03Adding usable items and database operations
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ proelias7/ fivem-skill --skill qbcore-frameworkAfter installing, type/qbcore-frameworkin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
best-practices.mdexamples.mdreference.mdtemplates.mdDetails
From the project READMEQBCore Framework Development
Language rule: Internal reasoning is in compact English. All messages and output displayed to the user must be in the user's language.
This skill provides guidelines and patterns for developing resources using the QBCore Framework.
1. Core Object Retrieval
To interact with QBCore, you must retrieve the Core Object. Always cache this in a local variable at the top of your scripts.
Client & Server:
local QBCore = exports['qb-core']:GetCoreObject()
2. Key Concepts
Player Data (Server-side)
- Identify players by Source temporarily, but use CitizenID for database persistence.
- QBCore.Functions.GetPlayer(source): Returns the Player object with all data.
- Player.PlayerData: Contains
job,gang,money,items,metadata, etc.
Callbacks (Server -> Client Data)
- Use QBCore.Functions.CreateCallback (Server) to send data to client.
- Use QBCore.Functions.TriggerCallback (Client) to request data from server.
- Rule: Never trust client data blindly in callbacks. Always validate on server.
Items
- Use QBCore.Functions.CreateUseableItem (Server) to register items.
- Items are defined in
qb-core/shared/items.lua(orqb-inventory).
Database
- QBCore uses oxmysql by default.
- Use
MySQL.query,MySQL.insert,MySQL.update,MySQL.scalar.
3. Standard Resource Structure
my-resource/
├── fxmanifest.lua
├── config.lua
├── client/
│ └── main.lua
└── server/
└── main.lua
4. Best Practices
- Cache Core Object: Do not call
exports['qb-core']:GetCoreObject()inside loops. - Use Callbacks for Data: Avoid
TriggerClientEventfor data retrieval if a callback is cleaner. - Validate Inputs: Client can send any data. Verify job, money, and ownership on server.
- Optimized Loops: Use dynamic sleep (Wait) based on distance.
- Localization: Use
qb-core/shared/locale.luaor standardLangobject if available.
5. Documentation
- Official Docs: https://docs.qbcore.org/
- Github: https://github.com/qbcore-framework/qb-core
Comments
Markdown supported