[Release] Event-based Scaleform Library

A library of GTA 5 scaleforms for FiveM. All scaleforms can be activated using events.

All events are client-side only. If you want to use them from server-side too, you will need to register them in cl_main.lua.

As I find more usable scaleforms, I will keep this resource updated. If you know some cool scaleforms, feel free to make a PR.

You can find working examples for every scaleform in cl_examples.lua.

Current list of scaleforms included:

  • TriggerEvent("cS.HeistFinale", _initialText, _table, _money, _xp, _waitTimeSeconds, _playSound) – check cl_examples.lua. There’s alot of data that needs to be used here.

  • TriggerEvent('cS.banner', _title, _subtitle, _waitTimeSeconds, _playShound)

  • TriggerEvent("cS.missionQuit", _title, _subtitle, _waitTimeSeconds, _playShound)

  • TriggerEvent("cS.SplashText", _text, _waitTimeSeconds, _playShound)

  • TriggerEvent("cS.PopupWarning", _title, _subtitle, _errorText, _waitTimeSeconds, _playShound)

  • TriggerEvent("cS.Countdown", _r, _g, _b, _waitTimeSeconds, _playSound)

  • TriggerEvent("cS.MidsizeBanner", _title, _subtitle, _waitTimeSeconds, _playShound)

  • TriggerEvent("cS.resultsPanel", _title, _subtitle, _slotsTable, _waitTimeSeconds, _playSound)

  • TriggerEvent("cS.Credits", roleString, namesString, xScreenCoord, yScreenCoord, _waitTimeSeconds, _playSound)

  • TriggerEvent('cS.Saving', _text, _waitTime, _playSound)

Download: GitHub - CritteRo/fivem-scaleform-lib: A library of GTA 5 scaleforms for FiveM. All scaleforms can be activated using events.

20 Likes

this has a nice example of what not to do - dont call scaleform functions in a loop unless absolutely neccessary, this will cause weirdness and other issues with certain scaleforms, instead call functions that are essential in the loop, and just call the others after the scaleform has been requested.

4 Likes

Should be easy to fix. I’ll update it as soon as I can.

Update:

  • Scaleform building functions no longer run in a loop (except Countdown, but that’s needed for now).

To do:

  • Currently, every time your run an event, the client generates a new scaleform. This is kinda bad if you want to update scaleforms before they disspear from the screen. Also, when the first scaleform’s waitTime runs out, all scaleforms from that event will end, which is not that great.
    Fix needed: Events need to check if a scaleform is already active, and just update the waitTime and scaleform data.

Update:

  • Added OPENING_CREDITS scaleform. Still needs a bit of work, right now the event uses a “test” function of the scaleform, the proper credit block functions are not fading out properly for some reason.

You can find a working example in cl_examples.lua file. I’m also working on a Wiki on the resource github…if you’re into that…

Good job, I like it I will use that.

Yet another Update:

  • Added the ability to change the pause menu screen:
    cS.ChangePauseMenuTitle

NOTE: I wouldn’t really suggest using it here. It’s basically just a line of code. I am currently working on a resource designed to modify the entire frontend menu, and that will include the title too.

2 Likes

Update:

  • Added cS.Saving scaleform. This will show the “Saving…” scaleform at the bottom-right of the screen. You can add your own text on it.

Really nice !
GG for this work on scaleforms, I’ll surely try to find a use for these on my server !

unsure if you are aware, but its probably better using

in the cases of spinners, that way you can also utilise the natives related to it

Wished I knew about this native before building the scaleform :smiley:

For anyone wanting an easy solution:

function showBusySpinnerNoScaleform(_text)
    BeginTextCommandBusyspinnerOn("STRING")
    AddTextComponentSubstringPlayerName(_text)
    EndTextCommandBusyspinnerOn(1)
end

and a full working script:

RegisterCommand('save3', function()
    Citizen.CreateThread(function()
        showBusySpinnerNoScaleform("Test 1234")
        Citizen.Wait(3000)
        BusyspinnerOff() --actual native
    end)
end)
2 Likes

You should change examples in your github wiki to code blocks as well. That will prevent stuff like this happening for example when you use ~y~ for yellow text. (See screenshot)
image

This text can be found on the wiki page cS.HeistFinale · CritteRo/fivem-scaleform-lib Wiki · GitHub

Update:

  • Added a Game Feed panel scaleform:
TriggerEvent(_title, _subtitle, _textblock, _textureDict, _textureName, _rightAlign--[[bool]], _waitTime, _playSound--[[bool]])

3 Likes

Hi! Really awesome job!
Got 1 question - is it possible to move cS.resultsPanel up or down or at least put it over chat?

Yes. You need to go into the framework and change this line:

In order to put it somewhere on the page, you will have to use DrawScaleformMovie - Natives @ Cfx.re Docs instead.

1 Like

This is exactly what I was looking for!!! <3

1 Like

Has anyone got examples but in C#?


Do you have any idea why this is happening? It worked at the beginning, but suddenly it started shifting weirdly.

That’s weird. That scaleform should be drawn fullscreen, so there shouldn’t be any offset (not one that I can set, at least).

Are you using SetDrawOrigin - Natives @ Cfx.re Docs in your scripts? This might have something to do with it.

Actually no…