Before starting the installation, make sure that you have the latest version of FiveM, QBcore, OxLib installed - You will find links to them below.
What you need to install first:
-
Unpack the archive marko_leveling.rar in the folder of your resources, remove the postscript -master so that the folder remains with the name "marko_leveling".
-
Make sure you have OX lib installed - It is required to interact with the MySQL database.
-
Open HeldiSQL (Or another application) and import into your database importDB.sql
-
add ensure marko_leveling to config.cfg of your server at the end.
-
The entire script is ready for use.
Below are the methods of integrating the level system into profession scripts from 17Movement
See file 17MOVMENT_INTEGRATION.md for details.
You can easily customize the level system with Config.lua.
Config.Reward - Responsible for the amount of funds the player will receive after the reward trigger.
If you want to add another level, for example, for the operation of fishing, then add to Config.lua.:
fisherman = {
xp = 'fisherman_xp',
lvl = 'fisherman_lvl',
},Also add Config.Levels and Config.Reward operating on other lines
And according to the database, the new fisherman_lvl and fisherman_xp columns
Add a new line next to the others in the file \marko_leveling\ui\index.html:
<!-- Section for Fisherman -->
<div class="profession-section">
<h2><i class="fas fa-tree"></i> Fisherman</h2>
<p>Level: <span id="fisherman-level">1</span></p>
<p>Experience: <span id="fisherman-exp">0</span></p>
</div>Add a new line next to the others in the file \marko_leveling\ui\script.js:
document.getElementById('fisherman-level').innerText = data['fisherman_lvl'] || "0";
document.getElementById('fisherman-exp').innerText = data['fisherman_xp'] || "0";local src = source
TriggerEvent('addPlayerExperience', 'postman_xp', 1, src)Instead of postman_xp, you can use any of the database columns responsible for storing the player's experience, instead of 1, you can specify another amount of experience received by the player.
TriggerEvent('RewardPlayer', source, "none", 1, 'postman_lvl', 'true')Instead of postman_lvl you can use any of the database columns responsible for the level of the player, instead of "none", 1 you can specify the name of the item for example bandage and its quantity "bandage", 10.
- If you don't want to issue any item as a reward, leave the argument as none.
- If you want to issue only an item but no money, change 'true' to 'false'
Example:
TriggerEvent('RewardPlayer', source, "bandage", 10, 'postman_lvl', 'false')17Movment - Thanks to the developers for the great scripts presented.
QBcore Current version tags on this repository. OxLib Current version of tags on this repository.
- Marko Scripts - marko_leveling - Discord
- V-1.0 - Release version.