mz-skills

Installation and configuration - Configuring mz-skills in your qb-core server for the first time.

INSTALLING MZ-SKILLS

  1. The first step when looking to utilise mz-skills is to ensure that you are running the latest version. The latest version can always be found at:

https://github.com/MrZainRP/mz-skills

  1. Once mz-skills is in your resources/[qb] folder, make sure you run the "skills.sql" sql-script to ensure that your "players" table configures to now include the "skills" column.

USING MZ-SKILLS ALONGSIDE OTHER SKILL SYSTEMS

  1. Please note, you are not able to run mz-skills with B1-skillz - or other skill based qb-core resources which utilise the same player table. Doing so may result in corrupted data which will not properly save in your server database.

  2. If you wish to use B1-skillz to alter GTA native skills as well as to create an RP skill system to reward players for certain RP-related tasks then you will need to:

    1. set "Config.B1Natives = false" to "true" in mz-skills/config.lua.

    2. uncomment the B1-skillz natives which commence with "["Stamina"]" at the end of the mz-skills/config.lua.

ACCESSING A PLAYER'S SKILLS INSIDE THE SERVER/CITY

  1. If you wish to allow players to check their skill menu using the radial menu, add this to qb-radialmenu/config.lua - line 296 and following:

    [3] = {
        id = 'skills',
        title = 'Check Skills',
        icon = 'triangle-exclamation',
        type = 'client',
        event = 'mz-skills:client:CheckSkills',
        shouldClose = true,
    },
  1. Otherwise, if "Config.TypeCommand = true", players can type the word /skills (and the word can be changed by changing "Config.Skillmenu" to access their skill menu.

USING MZ-SKILLS IN YOUR SERVER

  1. Before you start playing with particular skills, you should go through the mz-skills/config.lua and ensure that the skills are labelled as you wish to see them in the server. Skills attach to their label, so changing the label after the event will present difficulties. The default skills are as follows:

Config.Skills = {
    ["Searching"] = {
        ["Current"] = 0,
        ["RemoveAmount"] = 0,
        ["Stat"] = "BINDIVE_ABILITY",
        ['icon'] = 'fas fa-trash', 
    }, 
    ["Scraping"] = {
        ["Current"] = 0,
        ["RemoveAmount"] = 0,
        ["Stat"] = "SCRAP_ABILITY",
        ['icon'] = 'fas fa-screwdriver', 
    },
    ["Hacking"] = {
        ["Current"] = 0,
        ["RemoveAmount"] = 0,
        ["Stat"] = "HACK_ABILITY",
        ['icon'] = 'fas fa-laptop-code',
    }, 
    ["Street Reputation"] = {
        ["Current"] = 0,
        ["RemoveAmount"] = 0,
        ["Stat"] = "DRUGREP_ABILITY",
        ['icon'] = 'fas fa-cannabis',
    }, 
    ["Drug Manufacture"] = {
        ["Current"] = 0,
        ["RemoveAmount"] = 0,
        ["Stat"] = "DRUGMAKE_ABILITY",
        ['icon'] = 'fas fa-pills',
    }, 
    ["Delivery Runner"] = {
        ["Current"] = 0,
        ["RemoveAmount"] = 0,
        ["Stat"] = "RUNNER_ABILITY",
        ['icon'] = 'fas fa-car',
    }, 
    ["Hitman"] = {
        ["Current"] = 0,
        ["RemoveAmount"] = 0,
        ["Stat"] = "HITMAN_ABILITY",
        ['icon'] = 'fas fa-skull',
    }, 
    ["Sprint Driving"] = {
        ["Current"] = 0,
        ["RemoveAmount"] = 0,
        ["Stat"] = "DRIVER_ABILITY",
        ['icon'] = 'fas fa-car-alt',
    }, 
    ["Lumberjack"] = {
        ["Current"] = 0,
        ["RemoveAmount"] = 0,
        ["Stat"] = "TREE_ABILITY",
        ['icon'] = 'fas fa-tree',
    }, 
    ["Heist Reputation"] = {
        ["Current"] = 0,
        ["RemoveAmount"] = 0,
        ["Stat"] = "HEIST_ABILITY",
        ['icon'] = 'fa-solid fa-user-secret',
    }, 
    ["Diving"] = {
        ["Current"] = 0,
        ["RemoveAmount"] = 0,
        ["Stat"] = "DIVING_ABILITY",
        ['icon'] = 'fas fa-water',
    }, 
    ["Electrical"] = {
        ["Current"] = 0,
        ["RemoveAmount"] = 0,
        ["Stat"] = "ELECTRICAL_ABILITY",
        ['icon'] = 'fas fa-bolt',
    }, 

Adjusting skill values or XP

  1. To incease a player's XP in a particular skill, the relevant export is:

  ["mz-skills"]:UpdateSkill(skill, amount)
  1. If you elect to use the default skills (which the balance of the mz-resources utilise by default), then to update "Searching" from bin-diving - by way of example - as used with mz-bins:

exports["mz-skills"]:UpdateSkill("Searching", 1)
  1. In the above illustration, the argument "Searching" can be set as a config entry, for example: Config.SkillUsed = "Searching". The argument "1" can be any integer, including math.random integers.

  2. For example:

   local searchgain = math.random(1, 3)
   exports["mz-skills"]:UpdateSkill("Searching", searchgain)
  1. To remove a skill value (for example, because a player fails a skillcheck or cancels a progressBar), it is best to "add" a negative number. For example:

  local skillloss = -1
  exports["mz-skills"]:UpdateSkill("Searching", skillloss)
  1. Please note, mz-skills provides notifications when skill point(s) are added to a skill - but not when skills are taken away. If you wish for there to be a notification following a skill being reduced you will need to include that notification in the resource you are amending to produce a skill point reduction.

Checking a skill value or XP

  1. To check a player's skill/XP level in respect of a particular skill, the relevant export is:

  exports["mz-skills"]:CheckSkill(skill, val)
  1. You can use a skill check to lock particular content behind a certain skill/XP level, for example:

exports["mz-skills"]:CheckSkill("Searching", 100, function(hasskill)
    if hasskill then
        TriggerEvent('mz-bins:client:Reward')
    else
        QBCore.Functions.Notify('You need at least 100XP in Searching to do this.', "error", 3500)
    end
end)

Other matters

  1. You are able to manually adjust a player's skill level by opening the "players" database and searching for each relevant skill. If you want the changes you make to stick, the player cannot be in the server/city at the time of the adjustment. Your txAdmin update window will dicatate how long the player needs to remain out of the server/city before changes stick.

Last updated