FiveM Projects
This guide walks through the process of implementing SunLicense license management in a FiveM resource.
Prerequisites
Step 1: Set Up Basic Structure
-- license_check.lua
local SunLicenseValidator = {}
SunLicenseValidator.__index = SunLicenseValidator
-- Configuration
local CONFIG = {
API_URL = "http://localhost:8080/api/v1/validate",
LICENSE_KEY = GetConvar("sunlicense_key", "YOUR-LICENSE-KEY"),
PRODUCT_ID = 602, -- Replace with your product ID
VERSION = "1.0.0"
}Step 2: Implement the Validator Class
Step 3: Initialize the License Check
Step 4: Configure Your Resource
Best Practices
Common Issues and Solutions
Network Connectivity Problems
Invalid License Format
Failed Validation Response
Last updated