HU/setBlipIcon: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Server client function}} This function sets the icon for an existing blip element. ==Szintaxis== <syntaxhighlight lang="lua">bool setBlipIcon ( blip theBlip, int...")
 
No edit summary
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Server client function}}
{{Server client function}}
This function sets the icon for an existing blip element.
Ez a funkció beállít egy icont egy meglévő blip elemre.


==Szintaxis==  
==Szintaxis==  

Revision as of 16:24, 24 July 2018

Ez a funkció beállít egy icont egy meglévő blip elemre.

Szintaxis

bool setBlipIcon ( blip theBlip, int icon )

OOP Syntax Help! I don't understand this!

Method: blip:setIcon(...)
Variable: .icon
Counterpart: getBlipIcon


Kötelező argumentumok

  • theBlip The blip you wish to set the icon of.
  • icon: A number indicating the icon you wish to change it do. Valid values are listed on the Blip Icons page.

Visszaadott érték

Returns true if the icon was successfully set, false if the element passed was not a valid blip or the icon value was not a valid icon number.

Példa

This example resets all blip icons to the default blip icon, 0.

-- Retrieve a table containing all the blips that exist
blips = getElementsByType ( "blip" )
-- Loop through the list, storing the blip from the table in the variable blipValue
for blipKey, blipValue in blips do
	-- Retrieve the blip's icon into the variable 'blipIcon'
	blipIcon = getBlipIcon ( blipValue )
	-- If the blip's icon wasn't the default already
	if ( blipIcon ~= 0 ) then
		-- Set the blip's icon to the default
		setBlipIcon ( blipValue, 0 )
	end
end

Lásd még

Fordította

Surge