GetBlipSize: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (Link to the Romanian translation of this page added.)
 
(11 intermediate revisions by 5 users not shown)
Line 1: Line 1:
__NOTOC__  
{{Server client function}}
This function gets the size of a blip.
__NOTOC__
This function gets the size of a blip..


==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">int getBlipSize ( blip theBlip )</syntaxhighlight>  
<syntaxhighlight lang="lua">int getBlipSize ( blip theBlip )</syntaxhighlight>  
{{OOP||[[blip]]:getSize|size|setBlipSize}}


===Required Arguments===  
===Required Arguments===  
Line 9: Line 11:


===Returns===
===Returns===
Returns an [[int]] indicating the size of the blip. The default value is 2.
Returns an [[int]] indicating the size of the blip. The default value is 2. The maximum value is 25.


==Example==  
==Example==  
Line 22: Line 24:
-- If the blip's size wasn't 2 (the default size) already
-- If the blip's size wasn't 2 (the default size) already
if ( blipSize ~= 2 ) then
if ( blipSize ~= 2 ) then
-- Set the blip's icon to the default
-- Set the blip's size to the default
setBlipSize ( blipValue, 2 )
setBlipSize ( blipValue, 2 )
end
end
Line 30: Line 32:
==See Also==
==See Also==
{{Blip_functions}}
{{Blip_functions}}
[[hu:getBlipSize]]
[[ro:getBlipSize]]

Latest revision as of 20:37, 18 July 2019

This function gets the size of a blip..

Syntax

int getBlipSize ( blip theBlip )

OOP Syntax Help! I don't understand this!

Method: blip:getSize(...)
Variable: .size
Counterpart: setBlipSize


Required Arguments

  • theBlip: The blip you wish to get the size of.

Returns

Returns an int indicating the size of the blip. The default value is 2. The maximum value is 25.

Example

This example will reset the size of all blips to the default.

-- 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 size into the variable 'blipSize'
	blipSize = getBlipSize ( blipValue )
	-- If the blip's size wasn't 2 (the default size) already
	if ( blipSize ~= 2 ) then
		-- Set the blip's size to the default
		setBlipSize ( blipValue, 2 )
	end
end

See Also