Skip to content

A modification to Kings#4220 qb-skillz - working off the unsupported custom line

License

Notifications You must be signed in to change notification settings

MrZainRP/mz-skills

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mz-skills

  • A database held skill/XP system for qb-core (and use with other mz-resources).
  • All credit to Kings#4220. This resource is based on the custom line branch of "B1-skillz" - for the original resource (with GTA V inherent modifications) please see: https://github.com/Burn-One-Studios/B1-skillz

[ Installation ]

  • Download the resource and drop it to your resource folder.
  • Import the SQL file to your server's database (i.e. run the sql file and make sure the database runs)
  • Add start mz-skills to your server.cfg (or simply make sure mz-skills is in your [qb] folder)

[ Using mz-skills ]

!. To Update a skill please use the following export:

    exports["mz-skills"]:UpdateSkill(skill, amount)

For example, to update "Searching" from bin-diving (as used with mz-bins)

    exports["mz-skills"]:UpdateSkill("Searching", 1)

You can randomise the amount of skill gained, for example:

   local searchgain = math.random(1, 3)
   exports["mz-skills"]:UpdateSkill("Searching", searchgain)

B. The export to check to see if a skill is equal or greater than a particular value is as follows:

    exports["mz-skills"]:CheckSkill(skill, val)

You can use this to lock content behind a particular 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)
  • The export to obtain a player's current skill to interact with other scripts is as follows:
    exports["mz-skills"]:GetCurrentSkill(skill)
  • For radial menu access to "skills" command 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,
    },

[ Previews ]

About

A modification to Kings#4220 qb-skillz - working off the unsupported custom line

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 100.0%