As there seems to be a lack of much info to do with scaleforms, I felt like this are too useful to not show how to use a few of them to create simple, but nice looking displays, such as this one:
Right, so lets say we wanted to create something like this but says “Wasted”. We would begin with requesting the scaleform by using: RequestScaleformMovie(scaleform)
and replacing scaleform
with the desired scaleform (I will leave a link to a file full of all the scaleforms, and I will also show how to use the functions too) In this case, we would want to request the scaleform mp_big_message_freemode
therefore, it would look a bit like: RequestScaleformMovie("mp_big_message_freemode")
Id reccomend using it in a variable so you dont have to type the same thing out over a few times.
So, for the Requesting of the scaleform it would look a bit like this in my case:
scaleform = RequestScaleformMovie("mp_big_message_freemode")
while not HasScaleformMovieLoaded(scaleform) do
Citizen.Wait(0)
end
After you have done this, we can get to adding the text to it, which we can find in the correct .as
file of the decompiled scaleform (see bottom for a full download of them). Upon entering the file you will see a lot of functions, the one i recommend for mp_big_message_freemode
would be SHOW_SHARD_WASTED_MP_MESSAGE
as it seems to work the best when adding the description section below the larger message.
Now onto the displaying portion. If we wanted to use the function SHOW_SHARD_WASTED_MP_MESSAGE
you would do something like PushScaleformMovieFunction(scaleform, "SHOW_SHARD_WASTED_MP_MESSAGE")
Change the scaleform part to the name of your scaleform unless you did what i did with using a variable on the requesting part of the scaleform like my example. Next, we want to show the text, since we want to show text we would push a string, like so: PushScaleformMovieFunctionParameterString("TEXT HERE")
right after the pushing the movie function.
so in this case so far it would look like:
scaleform = RequestScaleformMovie(scaleform)
while not HasScaleformMovieLoaded(scaleform) do
Citizen.Wait(0)
end
PushScaleformMovieFunction(scaleform, "SHOW_SHARD_WASTED_MP_MESSAGE")
PushScaleformMovieFunctionParameterString("~r~WASTED") -- the message we want to display
if we wanted a description, you would create another line and then push a string again such as “You commited suicide” or something like that,
after doing this, you would end the function off by doing PopScaleformMovieFunctionVoid()
also note that some scaleforms allow you to use multiple functions, so for them cases you would push another function after popping the last one.
Finally, depending on if you wanted to make it fullscreen or not you would use:
DrawScaleformMovieFullscreen(scaleform, red, green, blue, alpha, unk)
Or:
DrawScaleformMovie(scaleformHandle, x, y, width, height, red, green, blue, alpha, unk)
The way I would go about doing all of this would look something like:
Citizen.CreateThread(function()
function Initialize(scaleform)
local scaleform = RequestScaleformMovie(scaleform)
while not HasScaleformMovieLoaded(scaleform) do
Citizen.Wait(0)
end
PushScaleformMovieFunction(scaleform, "SHOW_SHARD_WASTED_MP_MESSAGE")
PushScaleformMovieFunctionParameterString("~r~WASTED")
PushScaleformMovieFunctionParameterString("You commited suicide")
PopScaleformMovieFunctionVoid()
return scaleform
end
scaleform = Initialize("mp_big_message_freemode")
while true do
Citizen.Wait(0)
DrawScaleformMovieFullscreen(scaleform, 255, 255, 255, 255, 0)
end
end)
Which would in turn look like:
and thats it!
Sorry if it wasnt too good of an explaination, it isnt something im really good at, i just wanted to let people know of how useful this stuff can be. Finally, here is the list of scaleforms:
Full list of scaleforms decompiled!
@Vespura’s list of scaleforms online!
http://scaleform.devtesting.pizza