GetPlayerMapOpacity: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 13: | Line 13: | ||
==Example== | ==Example== | ||
<section name="Client" class="client" show="true"> | |||
This example implements a command that tells you what your current map opacity is. | |||
<syntaxhighlight lang="lua"> | |||
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) | |||
</syntaxhighlight> | |||
</section> | |||
==Requirements== | ==Requirements== |
Latest revision as of 09:31, 12 October 2021
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 [-]
ClientThis 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)
Requirements
Minimum server version | n/a |
---|---|
Minimum client version | 1.5.8-9.20945 |
Note: Using this feature requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version client="1.5.8-9.20945" />
See Also
- getLocalPlayer
- getPlayerMapBoundingBox
- getPlayerMapOpacity
- isPlayerMapVisible
- resetBlurLevel
- isPlayerHudComponentVisible
Shared
- getPlayerTeam
- getPlayerBlurLevel
- setPlayerBlurLevel
- getPlayerSerial
- forcePlayerMap
- getPlayerFromName
- getPlayerMoney
- getPlayerName
- getPlayerNametagColor
- getPlayerNametagText
- getPlayerPing
- getPlayerWantedLevel
- givePlayerMoney
- isPlayerMapForced
- isPlayerNametagShowing
- setPlayerHudComponentVisible
- setPlayerMoney
- setPlayerNametagColor
- setPlayerNametagShowing
- setPlayerNametagText
- takePlayerMoney
- countPlayersInTeam
- getPlayersInTeam
- isVoiceEnabled
- setControlState
- getControlState