GetBlipIcon: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
(11 intermediate revisions by 7 users not shown)
Line 1: Line 1:
__NOTOC__  
{{Server client function}}
This function returns the icon a blip currently has.
__NOTOC__
This function returns the icon a [[blip]] currently has.
==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">int getBlipIcon ( element blip )</syntaxhighlight>  
<syntaxhighlight lang="lua">int getBlipIcon ( blip theBlip )</syntaxhighlight>
{{OOP||[[blip]]:getIcon|icon|setBlipIcon}}
===Required Arguments===
*'''theBlip''': the blip we're getting the icon number of.


===Returns===
===Returns===
Returns an [[int]] indicating which icon is in use. Valid values are:
Returns an [[int]] indicating which icon the blip has. Valid values are listed on the [[Radar Blips]] page.
{{Blip_Icons}}


==Example==  
==Example==  
Line 14: Line 17:
blips = getElementsByType ( "blip" )
blips = getElementsByType ( "blip" )
-- Loop through the list, storing the blip from the table in the variable blipValue
-- Loop through the list, storing the blip from the table in the variable blipValue
for blipKey, blipValue in blips do
for blipKey, blipValue in ipairs(blips) do
-- Retrieve the blip's icon into the variable 'blipIcon'
-- Retrieve the blip's icon into the variable 'blipIcon'
blipIcon = getBlipIcon ( blipValue )
blipIcon = getBlipIcon ( blipValue )
Line 27: Line 30:
==See Also==
==See Also==
{{Blip_functions}}
{{Blip_functions}}
[[hu:getBlipIcon]]
[[ro:getBlipIcon]]

Latest revision as of 20:18, 18 July 2019

This function returns the icon a blip currently has.

Syntax

int getBlipIcon ( blip theBlip )

OOP Syntax Help! I don't understand this!

Method: blip:getIcon(...)
Variable: .icon
Counterpart: setBlipIcon


Required Arguments

  • theBlip: the blip we're getting the icon number of.

Returns

Returns an int indicating which icon the blip has. Valid values are listed on the Radar Blips page.

Example

This example will find all the blips that exist and set them all to the default blip icon.

-- 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 ipairs(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

See Also