Giter Club home page Giter Club logo

progressbar's Introduction

Mythic Progress Bar

A simple action bar resource which allows actions to be visually displayed to the player and provides a callback function so actions can be peformed if the event was cancelled or not.

How To Use:

To use, you just need to add a TriggerEvent into your client script where you're wanting the event to happen. Example TriggerEvent call;

    TriggerEvent("mythic_progbar:client:progress", {
        name = "unique_action_name",
        duration = 10000,
        label = "Action Label",
        useWhileDead = false,
        canCancel = true,
        controlDisables = {
            disableMovement = true,
            disableCarMovement = true,
            disableMouse = false,
            disableCombat = true,
        },
        animation = {
            animDict = "missheistdockssetup1clipboard@idle_a",
            anim = "idle_a",
        },
        prop = {
            model = "prop_paper_bag_small",
        }
    }, function(status)
        if not status then
            -- Do Something If Event Wasn't Cancelled
        end
    end)

Most of these flags are fairly self-explanatory, but theres's a few that have several options;

controlDisables - This allows you to disable a few sets of controls, these are broken down into 4 sets that I've found most often I was wanting to disable at some point;

  • disableMovement | Standard Character Movement
  • disableCarMovement | Vehicle Movement Keys
  • disableMouse | Moving mouse thus intern camera around ped
  • disableCombat | Weapon firing & Melee attacking

animation - This allows you to define an animation to play while the event occurs. This has several options that can be used and uses a cascading options to determine which to play. Highest priority is a Task, than it'll use AnimDict & Anim, if neither of those exist but the animation list exists in the options it'll default to a hardcoded task.

  • task | Highest priority - if defined, this will be the only value used for animation
  • animDict & anim & flags | Second highest priority, if task isn't defined it will try to use these values. Flags isn't required, and if it isn't provided will default to 1 (full body uncontrollable)
  • empty animation { } | Final fallback, if the animation list is still provided but nothing set (Or no valid names set) it will default to playing the PROP_HUMAN_BUM_BIN task.

prop - This will spawn the given prop name onto the player peds hand

  • model | This will be the model name used to spawn the prop onto the player ped.

progressbar's People

Contributors

alzar avatar

Stargazers

 avatar  avatar

Watchers

 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.