GetLicense
This exports retrieves license information, including label, validity period, and prices.
exports.bcs_licensemanager:GetLicense(license, cb)
Parameters
Params | Data Type | Description |
---|---|---|
license | string | License name |
cb (optional) | function | Callback function return data |
Example
HasLicense
This exports checks if a player has a license
exports.bcs_licensemanager:HasLicense(target, license)
Parameters
Params | Data Type | Description |
---|---|---|
target | number | The player server id |
license | string | License name (not label) |
Example
local have = exports.bcs_licensemanager:HasLicense(source, 'weapon')
if have then
print('The player has weapon license!')
else
print('The player does not have the weapon license')
end
local license = exports.bcs_licensemanager:GetLicense('weapon')
print(json.encode(license, {indent = true}))
-- Or
exports.bcs_licensemanager:GetLicense('weapon', function(license)
print(json.encode(license, {indent = true}))
end)
Last updated on