GetPlayerMapOpacity: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Remove obsolete Requirements section)
Line 25: Line 25:
</syntaxhighlight>
</syntaxhighlight>
</section>
</section>
==Requirements==
{{Requirements|n/a|1.5.8-9.20945}}


==See Also==
==See Also==
{{Client_player_functions}}
{{Client_player_functions}}

Revision as of 17:28, 7 November 2024

This function allows to get the opacity of the radar map (F11).

Syntax

int getPlayerMapOpacity ( )

OOP Syntax Help! I don't understand this!

Method: player.getMapOpacity(...)


Returns

Returns an integer with a value from 0 to 255, where 0 is fully transparent and 255 is fully opaque.

Example

Click to collapse [-]
Client

This example implements a command that tells you what your current map opacity is.

function showMapOpacity()
	-- We get the map opacity value
	local mapOpacity = getPlayerMapOpacity()
	-- We tell what the map opacity is to the player
	outputChatBox("Your map's opacity is at "..mapOpacity, 0, 255, 0)
end
addCommandHandler("mapopacity", showMapOpacity)

See Also