GuiProgressBarSetProgress: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(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...)
 
No edit summary
Line 1: Line 1:
{{client function}}
{{client function}}
This function is used to set the progress of a progressbar.
This function is used to set the progress of a progressbar as a percentage.


==Syntax==
==Syntax==
Line 10: Line 10:
*'''theProgressbar''': The progressbar you want to change the progress of
*'''theProgressbar''': The progressbar you want to change the progress of
*'''progress''': a float ranging from 0 - 100
*'''progress''': a float ranging from 0 - 100


===Returns===
===Returns===
Returns true if the progress was set, false otherwise.
Returns true if the progress was set, false otherwise.


==Example==
==Example==

Revision as of 19:26, 6 November 2007

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

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