Framework Support
sh-licenses supports both VORP and RSG frameworks. Set the framework in your server-sideconfig.lua:
config.lua
'auto' (the default) lets the resource detect your running framework automatically.
How the License System Works
Each license type is an entry inConfig.Licenses with its own inventory item name, price, expiry period, allowed-jobs gate, and a set of custom fields the purchaser fills in. When a player visits a clerk NPC and purchases a license, the resource:
- Validates the purchaser’s identity (optionally via sh-identity) and checks job access.
- Charges the configured fee breakdown (base price + optional service, processing, and tax).
- Creates a database record and gives the player the corresponding inventory item.
- Posts a Discord webhook log entry if logging is enabled.
Config.Database.table, default: sh_licenses).
Defining License Types
Every license is an entry inConfig.Licenses. Each entry requires a unique key, an inventory item name, a price, an expiry period, and any custom fields to collect at issuance. The allowedJobs list restricts which jobs can purchase the license — set to nil to allow any player:
config.lua
Default License Types
The following licenses are included in the default configuration as a starting point:Business License
Business License
Issued to players operating a business. Fields include business name, type (chosen from a configurable list), and location. Priced at $500 by default with a 60-day expiry. Restricted to the
realtor job by default — edit allowedJobs to match your server’s issuing role.Cannabis Cultivation License
Cannabis Cultivation License
Required to legally operate a grow operation. Collects farm name and location. Priced at $2,000 with a 30-day expiry. Restricted to
cannabis, cannabisfarmer, and farmer jobs by default.Pharmacist License
Pharmacist License
Issued to licensed pharmacists. Collects pharmacy name, location, and registration number. Priced at $600 with a 60-day expiry.
Doctor License
Doctor License
Issued to practicing physicians. Collects clinic name, specialty, and medical license number. Priced at $550 with a 30-day expiry.
Nurse License
Nurse License
Issued to nursing staff. Collects hospital name, department, and nurse license number. Priced at $125 with a 30-day expiry.
Clerk NPC Configuration
Clerk NPCs are placed at configured world locations and handle license issuance. You can restrict which jobs are permitted to operate the clerk desk usingConfig.ClerkAccess:
config.lua
Fee Breakdown
Each license has its own baseprice. On top of that, you can configure optional service charges, processing fees, and a tax percentage that apply globally across all license purchases:
config.lua
Issuance Modes
The clerk desk supports two issuance modes selectable from the NUI:- Self — the license is issued directly to the clerk’s own character. Useful when a player is both the clerk and the recipient.
- Nearest — the license is issued to the nearest player within
Config.Issuance.targetRadius(default: 4.0 m). The target must remain in range during the transaction.
config.lua
sh-identity Integration
When sh-identity is running alongside sh-licenses, identity fields on the license form are automatically pre-filled from the character’s registered real ID record. This prevents players from entering mismatched details:config.lua
Discord Logging
Every license purchase is logged to a configurable Discord webhook:config.lua
License Persistence
Licenses are stored per-character in the database table specified byConfig.Database.table (default: sh_licenses). They persist across server restarts and character sessions. Each character maintains an independent license set. The Config.Database.preferDb option (default: true) ensures the display always reads from the database record rather than item metadata.
Installation
Add to server.cfg
Ensure sh-licenses after your framework and before any resource that checks license status:
server.cfg
Import the SQL file
Run the SQL file from the
sql/ folder of the resource against your database to create the character license records table.Register inventory items
Register each license item name (e.g.
license_business, license_doctor) as a usable item in your framework’s item registry. Item definition templates are included in the install/ folder.Configure licenses and clerk
Edit
Config.Licenses to define your license types, prices, and fields. Edit Config.Clerk.locations to position your clerk NPC, and set Config.ClerkAccess.allowedJobs to match the jobs that can operate the desk on your server.