guiProgressBarSetProgress | Multi Theft Auto: Wiki Skip to content

guiProgressBarSetProgress

Client-side
Server-side
Shared

Pair: guiProgressBarGetProgress

This function is used to set the progress of a progressbar as a percentage.

Syntax

bool guiProgressBarSetProgress ( ​gui-progressbar theProgressbar, ​float progress )
Required arguments
  • theProgressbar: The progressbar you want to change the progress of.
  • progress: A float ranging from 0 - 100

Returns

Returns true if the progress was set, false otherwise.

  • bool: result

Code Examples

client
local progressBar = guiCreateProgressBar(0.3, 0.4, 0.15, 0.03, true)
addCommandHandler('setProgress', function(cmd, value)
if (not tonumber(value)) then
return
end
guiProgressBarSetProgress(progressBar, tonumber(value))
end)

See Also

GUI Functions