qb-skillz icon indicating copy to clipboard operation
qb-skillz copied to clipboard

[Suggestion] Use Native Gta Skill Up Notify

Open ihyajb opened this issue 2 years ago • 2 comments

I may PR this if I get around to it. But it has to do with this native: https://docs.fivem.net/natives/?_0x2B7E9A4EAAA93C89

Small Image + Code Snippet

image

Citizen.CreateThread(function()
    -- Get the ped headshot image.
    local handle = RegisterPedheadshot(PlayerPedId())
    while not IsPedheadshotReady(handle) or not IsPedheadshotValid(handle) do
        Citizen.Wait(0)
    end
    local txd = GetPedheadshotTxdString(handle)

    -- Add the notification text
    BeginTextCommandThefeedPost("PS_UPDATE")
    AddTextComponentInteger(50)

    -- Set the notification title and progress
    local title = "PSF_STAMINA"
    local p1 = 14
    local lastProgress = 25
    local newProgress = 50
    local unknownBool = false
    EndTextCommandThefeedPostStats(title, p1, newProgress, lastProgress, unknownBool, txd, txd)

    -- Draw the notification
    local showInBrief = true
    local blink = false -- blink doesn't work when using icon notifications.
    EndTextCommandThefeedPostTicker(blink, showInBrief)
    
    -- Cleanup after yourself!
    UnregisterPedheadshot(handle)
end)

ihyajb avatar May 12 '22 08:05 ihyajb