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.
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.
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.
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.
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.
Wished I knew about this native before building the scaleform
For anyone wanting an easy solution:
function showBusySpinnerNoScaleform(_text)
BeginTextCommandBusyspinnerOn("STRING")
AddTextComponentSubstringPlayerName(_text)
EndTextCommandBusyspinnerOn(1)
end
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)