Page cover

Core

The main core of the Prix Framework is prix_core, it is essential that you install it.

📦 Prix Core (prix_core)

Prix Core is a lightweight core script required by other resources. It ensures that dependent scripts can only run when Prix Core is active and prevents players from bypassing it by removing dependencies.

GitBook


✨ Features

  • ✅ Startup messages in both server console and client F8 console

  • ✅ Exports a function GetCoreStatus used by dependent resources

  • ✅ Prevents bypassing by runtime checks (not just dependency tags)


⚙️ Installation

  1. Place the prix_core folder inside your resources directory.

  2. Add the following line to your server.cfg:

ensure prix_core

🚀 How to Use Prix Core in Other Scripts

1. Add Dependency

In your resource fxmanifest.lua:

dependency 'prix_core'

2. Runtime Check (Server-side)

if exports['prix_core']:GetCoreStatus() then
    print("Prix Core is active. This resource can run.")
else
    print("Prix Core is missing. Stopping this resource.")
    StopResource(GetCurrentResourceName())
end

3. Runtime Check (Client-side)

if exports['prix_core']:GetCoreStatus() then
    print("Prix Core is active on client.")
else
    print("Prix Core is missing. This resource will not run.")
end

🛒 Example: Vehicle Shop Resource

A simple demo script that requires Prix Core to function.

fxmanifest.lua

fx_version 'cerulean'
game 'gta5'

name 'vehicle_shop'
author 'Prix'
description 'Example vehicle shop requiring Prix Core'
version '1.0.0'

dependency 'prix_core'

server_script 'server.lua'
client_script 'client.lua'

server.lua

if not exports['prix_core']:GetCoreStatus() then
    print("[Vehicle Shop] Prix Core not found. Stopping resource.")
    StopResource(GetCurrentResourceName())
    return
end

print("[Vehicle Shop] Prix Core found. Resource started successfully.")

client.lua

if not exports['prix_core']:GetCoreStatus() then
    print("[Vehicle Shop] Prix Core not found. This script will not run.")
    return
end

print("[Vehicle Shop] Prix Core found. Client script is running.")

📝 Notes

  • Removing dependency 'prix_core' will not bypass the system, since every script should verify Prix Core at runtime.

  • Always ensure Prix Core is loaded before any dependent resources.

💡 Recommended: Keep prix_core minimal and stable, so it can serve as a foundation for multiple scripts without frequent updates.

Last updated