Skip to content

Conversation

@programmernb-ctrl
Copy link

qbx.drawMissionText

This PR adds qbx.drawMissionText to modules/lib.lua

---@class LibDrawMissionTextParams
    ---@field text string
    ---@field time number default: 5000 - 5s

    ---Draws default GTAV notification text with a given time on the screen.
    ---@param params LibDrawMissionTextParams
    function qbx.drawMissionText(params)
        local text = params.text
        local time = params.time or 5000
        ClearPrints()
        ClearSmallPrints()
        BeginTextCommandPrint('STRING')
        AddTextComponentSubstringPlayerName(text)
        EndTextCommandPrint(time, true)
    end

Here is a example how to use

qbx.drawMissionText({ text="QBOX Lover", time=10000 })

Checklist

  • I have personally loaded this code into an updated Qbox project and checked all of its functionality.
  • My pull request fits the contribution guidelines & code conventions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant