QBOX
Last updated
Last updated
or other target with identical format as qb-target (not guaranteed to work)
Place the ylean_loans
folder into your server's resources
directory.
Import sql.sql
into your MySQL database.
Add job settings from job.txt
into ...\qbx_core\shared\jobs.lua
The Ylean.BrokerJob
table defines the core settings for the “financial” job (the broker role). Any change in this section—both the name
field and any modifications to the grades
table—must be mirrored in your server’s main job configuration.
name
Must exactly match the job name defined in your main configuration file.
grades
Each key ('0'
, '1'
, '2'
, etc.) must correspond to a grade defined in that same configuration.
Any addition, removal, or renumbering of grades here must be applied to the main job config as well.
Any player who holds the “financial” job at a rank where the isBoss
variable is set to true has access to the boss menu.
Both Business Loans and Individual Loans use the same interestRate
configuration block. It controls how the loan’s interest rate is chosen based on whether you want a fixed rate or a rate that changes with the repayment period.
constant = true
)Behavior
No matter what repayment term the player picks, the interest rate is always equal to value
.
Configuration
constant = false
)Behavior
For a 1-day loan, use the min
rate.
For a loan at the maximum allowed deadline (defined by maximumDeadline
), use the max
rate.
For any term in between, interpolate linearly between min
and max
.
Linear interpolation formula
Configuration
This section explains how to add or edit translations for ylean_loans, covering both the NUI (front-end) and server (back-end) locales, as well as the main NUI HTML file.
Directory: ylean_loans/nui/locales/
Contains pre-translated JSON files, e.g. en.json
, pl.json
, etc.
Add or Edit a Language
Create or modify your_lang.json
in that folder.
Open ylean_loans/nui/index.js
.
Find the line:
and add or change the code to your filename (without .json
):
Directory: ylean_loans/locales/
Contains Lua locale files, e.g. en.lua
, pl.lua
, etc.
Add or Edit a Language
Create or modify yourLang.lua
in that folder.
Open config.lua
.
Find the Ylean.Locales
table and add your filename (without .lua
):
File: ylean_loans/nui/index.html
Contains static text (headings, placeholders) that may need translation beyond what your JSON files cover.
Edit for Your Language
Open index.html
.
Translate any hard-coded strings
Restart script
With these steps, you can fully localize ylean_loans in both the UI and server logic. Remember to keep your filenames (without extensions) consistent when referencing them in index.js
and config.lua
.
To switch the currency symbol shown throughout ylean_loans, update three places: the back-end Lua locales, the NUI JSON locales, and the NUI script.
Back-End (Lua Locales)
Open the appropriate file in ylean_loans/locales/
(e.g. en.lua
, pl.lua
).
Locate any entries containing the currency symbol (for example a key like insufficientCreditScore = "Insufficient credit score for a $%d loan! Max allowed: $%d"
or inline strings).
Replace "$"
with your desired symbol (e.g. "€"
).
Save and restart the resource to apply changes.
Front-End NUI (JSON Locales)
Open the corresponding JSON file in ylean_loans/nui/locales/
(e.g. en.json
, pl.json
).
Find any keys or values that include the currency symbol (for example "validate_repayment_range": "Repayment Amount must be between $"
).
Replace "$"
with your desired symbol.
Save the file and reload the NUI to see the updated labels.
Front-End NUI Script
Open ylean_loans/nui/index.js
.
Find the line:
Change it to your new symbol, for example:
Save the file and reload the script (e.g., via ensure ylean_loans
).
After completing these three steps, all monetary values and labels in both the UI and server logic will use your new currency symbol.
To adjust how dates are displayed in the NUI:
Open ylean_loans/nui/index.js
.
Locate the line:
Save the file and reload the script (e.g., via ensure ylean_loans
).
The UI will now format all dates according to your chosen locale.
The reminder system alerts borrowers as their payment deadline approaches:
Activation: Controlled by notifyAboutUpcomingRepayment.active
in each loan’s configuration namespace (IndividualLoanRepayment
or BusinessLoanRepayment
).
Threshold: Defined by notifyAboutUpcomingRepayment.hours
—reminders start when the time until the deadline is less than or equal to this value.
Frequency: Once the threshold is reached, borrowers receive a notification every hour until they either repay the loan or the deadline passes and the deduction or interest-accrual procedure is triggered.
To configure:
Enable or disable reminders with the active
flag.
Set the hours
value to determine how far in advance hourly reminders begin.
In this mode, once the repayment deadline passes, the system automatically deducts the full outstanding balance from the borrower’s bank account. This applies to both individual and business loans, subject to the following configuration:
Enable/Disable: Controlled by the immediateDeduction
flag in each loan’s settings.
Credit Score Penalty (individual loans only): If enabled, a fixed number of credit score points (creditScoreLostInCaseOfDelay
) is deducted when the funds are collected.
Notification: Upon deduction, a log entry and optional webhook notification (e.g., Discord) inform administrators and the borrower of the action.
All related configuration options are defined within the Ylean.IndividualLoanRepayment
and Ylean.BusinessLoanRepayment
namespaces.
Configuration Steps:
Set immediateDeduction = true
to activate this mode.
(Individual loans) Define creditScoreLostInCaseOfDelay
to apply penalties for delayed repayment.
This mode gradually increases the loan amount by a daily interest rate, providing a grace period before enforcing a full deduction:
Interest Accrual: The outstanding principal is multiplied by (1 + interestRate)
once per day, compounding until collection.
Grace Period: A configurable number of days (daysBeforeDeduction
) gives borrowers time to repay without immediate loss of funds.
Final Collection: After the grace period, the total accumulated balance (principal plus accrued interest) is deducted in full. Individual loans may also incur a credit score penalty at this point.
All related configuration options are defined within the Ylean.IndividualLoanRepayment
and Ylean.BusinessLoanRepayment
namespaces.
Configuration Steps:
Set immediateDeduction = false
to use interest accrual.
Define interestRate
(daily rate) and daysBeforeDeduction
(grace period).
(Individual loans) Optionally configure creditScoreLostInCaseOfDelay
for score penalties upon final collection.
Activation
immediateDeduction = true
immediateDeduction = false
Interest before deduction
None
Accrued daily until the threshold
Status change
Immediately upon delay
After daysBeforeDeduction
days overdue
Funds deducted
Full principal
Accumulated principal + interest
Credit score impact
Individual loans only
Individual loans only
Key loan events can be logged to Discord via webhooks, with each action configurable individually under the YleanDC.Logs
namespace in discord_logs_cfg.lua
file.
Global Settings (YleanDC
):
ServerName
(string): Name of the server displayed in the embed footer.
DefaultEmbedColor
(integer): Default color code used for embeds when an event-specific color is not provided.
Per-Event Configuration: Each event under YleanDC.Logs
supports:
Enabled (boolean): Turn logging on or off.
WebhookURL (string): Discord webhook endpoint for that event.
BotName (string) and BotAvatar (string URL): Identity of the webhook bot.
Embed (object): Customization of the embed’s Title
, Color
, and Thumbnail
.
Configured Events:
LoanIndividualNoApproval
Player applied for an individual loan that does not require approval
LoanIndividualApproval
Player applied for an individual loan that requires approval
PartialLoanRepayment
Player made a partial repayment on a loan
FullLoanRepayment
Player fully repaid a loan
SubmitBusinessLoan
Employee submitted a business loan
AcceptBusinessLoan
Player accepted a business loan
RejectBusinessLoan
Player rejected a business loan
OverdueLoanIndividual
Player failed to repay an individual loan on time
OverdueLoanBusiness
Player failed to repay a business loan on time
EmployeeLoanIndividual
Employee granted an individual loan
EmployeeRejectLoanIndividual
Employee rejected an individual loan
EmployeeClockOut
Employee clocked out (ended duty)
EmployeeClockIn
Employee clocked in (started duty)
BossFireEmployee
Boss fired an employee
BossChangeJobGrade
Boss changed an employee's job grade
BossHireEmployee
Boss hired a new employee
CompanyBankDeposit
Deposit made into the company bank account
CompanyBankWithdrawal
Withdrawal made from the company bank account
Replace "en-US"
with any valid —for example: