Skip to content

Commit

Permalink
fix: use of the right variable name (scaleform) (#378)
Browse files Browse the repository at this point in the history
* fix: use of the right variable name

* Little nitpick on the variable name

Tested changes to make sure it works. I find the name scaleformHandle better than just scaleform, Lua is a dynamically typed language, and it's better to be descriptive for the non-familiar end-user. Great job spotting this by the way!

---------

Co-authored-by: ammonia-cfx <38232208+4mmonium@users.noreply.github.com>
  • Loading branch information
MoskalykA and 4mmonium committed Jul 1, 2023
1 parent 0f4824f commit ca37501
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions content/docs/scripting-manual/using-scaleform/_index.md
Expand Up @@ -118,20 +118,20 @@ Example

```lua
Citizen.CreateThread(function()
local ScaleformHandle = RequestScaleformMovie("mp_big_message_freemode") -- The scaleform you want to use
while not HasScaleformMovieLoaded(scaleform) do -- Ensure the scaleform is actually loaded before using
local scaleformHandle = RequestScaleformMovie("mp_big_message_freemode") -- The scaleform you want to use
while not HasScaleformMovieLoaded(scaleformHandle) do -- Ensure the scaleform is actually loaded before using
Citizen.Wait(0)
end

BeginScaleformMovieMethod(scaleform, "SHOW_SHARD_WASTED_MP_MESSAGE") -- The function you want to call from the AS file
BeginScaleformMovieMethod(scaleformHandle, "SHOW_SHARD_WASTED_MP_MESSAGE") -- The function you want to call from the AS file
PushScaleformMovieMethodParameterString("Big Text") -- bigTxt
PushScaleformMovieMethodParameterString("Smaller Text") -- msgText
PushScaleformMovieMethodParameterInt(5) -- colId
EndScaleformMovieMethod() -- Finish off the scaleform, it returns no data, so doesnt need "EndScaleformMovieMethodReturn"

while true do -- Draw the scaleform every frame
Citizen.Wait(0)
DrawScaleformMovieFullscreen(ScaleformHandle, 255, 255, 255, 255) -- Draw the scaleform fullscreen
DrawScaleformMovieFullscreen(scaleformHandle, 255, 255, 255, 255) -- Draw the scaleform fullscreen
end
end)
```

0 comments on commit ca37501

Please sign in to comment.