Code Monkey home page Code Monkey logo

mz-skills's Introduction

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 ]

mz-skills's People

Contributors

kingsage311 avatar mrzainrp avatar yavzkesta avatar manliketjb avatar theilleniumstudios avatar mystyleigh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.