Framework Integration
Introduction
Welcome to framework integration for PEFCL. We support multiple frameworks out of the box, as well as allow the option to use your own framework with a few simple exports.
Officially supported frameworks by PEFCL
- Download the framework integration bridge for your framework below.
- Update config.json
- Update server.cfg
Setting syncInitialBankBalance
will allow bank balance to be synced to the initial account created by PEFCL via the getBank
export from the framework integration resource.
QBCore
Download: qb-pefcl
Update config.json
"frameworkIntegration": {
"enabled": true,
"resource": "qb-pefcl",
"syncInitialBankBalance": true
}
- Update server.cfg (starting order)
ensure qb-pefcl
ensure pefcl
ESX
Download: pefcl-esx
Update config.json
"frameworkIntegration": {
"enabled": true,
"resource": "pefcl-esx",
"syncInitialBankBalance": true
}
- Update server.cfg (starting order)
ensure pefcl-esx
ensure pefcl
Custom framework, Required exports (Advanced)
If you're using a supported framework by PEFCL you can ignore this segment.
This is only for creating your own framework integration!
Start by configuring the config.json:
- Enable framework integration.
- Set which resource that contains the exports.
"frameworkIntegration": {
"enabled": true,
"resource": "your-resource",
"syncInitialBankBalance": true
}
You need to export the following functions from your framework integration resource, in this case "your-resource". All of these exports are server side.
- getCash(source:
number
):number
;- Should return cash balance from the framework player.
- getBank(source:
number
):number
;- Should return bank balance from the framework player.
- addCash: (source:
number
, amount:number
):void
;- Should add cash balance to the framework player.
- removeCash: (source:
number
, amount:number
):void
;- Should remove cash balance to the framework player.
- giveCard(source:
number
, card:Card
):void
;- Should add a bank_card to framework player inventory.
- getCards(source:
number
):InventoryCard
;- Should return cards from framework player inventory.
PEFCL uses these exports to integrate with your existing framework when handling cash. PEFCL takes care of everything related to accounts.
Interfaces
These are the interfaces that are related to framework exports.
giveCard(source: number
, card: Card
): void
;
export interface Card {
id: number;
account?: Account;
accountId?: number;
pin: number;
isBlocked: boolean;
holder: string;
number: string;
updatedAt?: string | number | Date;
createdAt?: string | number | Date;
}
getCards(source: number
): InventoryCard[]
;
export interface InventoryCard {
id: number;
holder: string;
number: string;
}