GuiProgressBarSetProgress

From Multi Theft Auto: Wiki
Revision as of 15:25, 6 November 2007 by Lucif3r (talk | contribs) (New page: {{client function}} This function is used to set the progress of a progressbar. ==Syntax== <syntaxhighlight lang="lua"> bool guiProgressBarSetProgress ( progressBar theProgressbar, float progress ) </co...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

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

Returns true if the progress was set, false otherwise.


Example

This example sets the progress of a bar called "somebar" created with guiCreateProgressBar, 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

General functions

Browsers

Buttons

Checkboxes

Comboboxes

Edit Boxes

Gridlists

Memos

Progressbars

Radio Buttons

Scrollbars

Scrollpanes

Static Images

Tab Panels

Tabs

Text Labels

Windows