Developer Access
Please enter the password to view the developer documentation.
QP-core Guide
An in-depth guide to the QP-core framework.
QP-core Specific Documentation
This section provides a more in-depth guide for working specifically with the QP-core framework. Understanding these concepts is crucial for ensuring script compatibility, proper configuration, and stable database management.
1. Identifying QP-core Compatibility
Not all scripts are plug-and-play. Before adding a new script to your server, you must first verify its compatibility with your QP-core version. Here’s how to do it:
- Check the
fxmanifest.lua/manifest.lua: This is the heart of any resource. Open this file and look for the following clues:dependency/dependencies: Look for entries like'qp-core','qp-base', or other common QP scripts. This is the most reliable sign.shared_script: Many QP-core scripts use a shared script for configuration or core functions. Look for something like'@qp-core/shared/locale.lua'or'shared/config.lua'.- Server/Client Exports: Check the
server_scriptsandclient_scriptssections. Files that useQBCore.Functions...are a clear indicator of a QBCore/QP-core script.
- Examine the Code: Open the main client and server files. If you see function calls like
QBCore.Functions.CreateCallback,QBCore.Functions.Notify, or references toPlayer.Functions, the script is designed for a QBCore-based framework. - Read the Documentation: Always check the resource's original documentation (e.g., on GitHub or the FiveM forums). The author will almost always state which framework the script is intended for.
2. Configuring QP-core Scripts
Proper configuration is key to making a script work correctly with your server's existing setup.
- The
config.luaFile: This is the most common place for script settings. Open this file first. It typically contains options for enabling/disabling features, setting positions (coordinates), and defining item names or prices. - Understanding
Config.vsQBCore.Config:Config.Something: This refers to a variable defined *within that script's own*config.lua.QBCore.Config.Something: This accesses the *core configuration* of the QP-core framework itself, usually found inqp-core/config.lua. Be very careful when a script modifies this, as it can have server-wide consequences.
- Don't Be Afraid to Translate: Sometimes a script is designed for QBCore but you are using a slightly modified version (like QP-core). You might need to update function calls. For example, a script might use an old notification function that needs to be updated to your server's current one. Use your text editor's "Find in Files" feature to locate and replace outdated functions.
3. Database Integration and Management
Many scripts require changes to the database to store player data, vehicle information, or other persistent details. Messing this up can lead to data loss or server crashes.
The Golden Rule: One-Time Execution
A resource's SQL file (usually named install.sql, database.sql, or similar) should only be run ONCE. Running it multiple times will either cause errors (if it tries to create tables that already exist) or, in worse cases, wipe existing data.
The Process:
- Locate the
.sqlFile: Find the SQL script that came with the resource. - Open with HeidiSQL/Database Manager: Open the
.sqlfile in your database management tool (like HeidiSQL). Review the commands. It will typically containCREATE TABLEorALTER TABLEstatements.CREATE TABLE: This is for adding a completely new table. It's generally safe to run if that table doesn't already exist.ALTER TABLE: This modifies an *existing* table, often to add a new column. This is common for scripts that extend core functionality (like adding a new field to theplayerstable). BE CAUTIOUS: Ensure you have a database backup before running anALTER TABLEcommand from a new script.
- Execute the Query: Run the entire SQL file. If you encounter an error like "Table 'tablename' already exists," it's a sign that you (or someone else) has already run this script. Do not proceed. Investigate first.
- Restart the Server: After the database has been successfully updated, restart your FiveM server to ensure the new script can connect to its tables properly.
By carefully following these steps, you can ensure that new scripts are added to your QP-core server in a safe, stable, and effective manner.