HU/setBlipIcon

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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 A blip melyre az icont szeretné állítani.
  • icon: Egy szám jelzi az icont, amit modosítani szeretne. Az érvényes értékeket megtalálja a Radar Blips oldalon.

Visszaadott érték

Visszaad egy true értéket, ha az icon sikeresen be lett állítva, false ha az elem egy érvénytelen blip volt, vagy ha az icon értéke nem egy érvényes icon szám.

Példa

Ez a példa visszaállítja az összes blip-ikont az alapértelmezett blip ikonra, 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