ylean_armslicence
Last updated
Last updated
(required for ox_target)
(instead of qb-target)
To switch from qb_target to ox_target, make sure you have correctly set the variable: Ylean.TargetResource
to "ox_target", like this:
The next step will be modifying the shared_scripts variable in the fxmanifest.lua file by adding '@ox_lib/init.lua'
(remember to install ox_lib beforehand).
To facilitate script translation, all strings that need to be translated have been gathered into as few files as possible. Below is a list of files that contain text for translation.
config.lua
nui/translation.js
nui/questions.js
nui/index.html
In the configuration file config.lua, you can extensively customize the theoretical exam according to your needs.
The exam question system works as follows: In the file questions.js, the user defines a pool of questions. From this pool, a number of questions, specified in the config file, are randomly selected for each attempt. This prevents repetition in the test and eliminates the possibility of the examinee memorizing the questions.
The user has the ability to configure questions and answers freely. These can include questions with 4-5 answer options, or even just two (YES or NO).
The configuration of the practical exam is entirely done in the config.lua file using two variables.
The variable Ylean.PracticalExamPedCoords
stores the coordinates of the peds used as training targets. At the same time, the number of entries determines the maximum number of points that can be earned in this test.
To switch the license management system from qb-core to the internal system, you need to set Ylean.UseInternalLicenseSystem = true in the config file.
The script supports the standard license system built into the qb-core framework and also includes its own internal system, which consists of:
the /weaponlic command – used to display the status of your license to nearby players
the /revokelic ID command – used by authorized personnel to revoke a player's license
an export that returns true or false, depending on the license status of a given player.
Here's an example of how to use the export:
To fully support license revocation by external scripts, an export called RevokePlayerLicense
has been implemented, which revokes the license and all progress toward obtaining a firearms permit.
Warning! The export does not include any authorization logic—any job checks or permission checks must be implemented before executing the revoke-license logic.