guiProgressBarSetProgress | Multi Theft Auto: Wiki Skip to content

guiProgressBarSetProgress

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


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

Syntax

bool guiProgressBarSetProgress ( progressBar theProgressbar, float progress )
Required Arguments
  • theProgressbar: The progressbar you want to change the progress of
  • progress: a float ranging from 0 - 100

Returns

  • bool: value

Returns true if the progress was set, false otherwise.

Code Examples

shared

This example sets the progress of a bar called "somebar" created withguiCreateProgressBar, and outputs it to the chatbox.

-- If the progressbar exsist then
if ( somebar ) then
-- set the progress
guiProgressBarSetProgress(somebar, 80)
-- get the progress
progress = guiProgressBarGetProgress(somebar)
-- output to the chatbox
outputChatBox ( "Current progress:" .. progress .. "%" )
else --if the progressbar was not found
outputChatBox ("progressbar not found!")
-- output a message
end

See Also

GUI Functions