IsPlayerMapVisible: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
Fernando187 (talk | contribs) No edit summary |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Client function}} | {{Client function}} | ||
This function checks if the local player has their map showing | |||
[[Image:MTAsa_Default_Map.png|thumb|224px|Screenshot of the default map]] | |||
This function checks if the local player has their map showing (F11). | |||
==Syntax== | ==Syntax== | ||
Line 8: | Line 11: | ||
===Returns=== | ===Returns=== | ||
Returns ''true'' if the player has the map visible, ''false'' otherwise. | Returns ''true'' if the player has the map visible, ''false'' otherwise. | ||
==Example== | ==Example== | ||
Line 51: | Line 24: | ||
function showMap() | function showMap() | ||
if isPlayerMapVisible() then | if isPlayerMapVisible() then | ||
outputChatBox(" | outputChatBox("Player-map closed", 0, 255, 0) | ||
forcePlayerMap(false) | forcePlayerMap(false) | ||
else | else | ||
outputChatBox("Viewing | outputChatBox("Viewing player-map", 0, 255, 0) | ||
forcePlayerMap(true) | forcePlayerMap(true) | ||
end | end |
Latest revision as of 11:50, 9 November 2024
This function checks if the local player has their map showing (F11).
Syntax
bool isPlayerMapVisible ()
Returns
Returns true if the player has the map visible, false otherwise.
Example
Click to collapse [-]
Example 1function checkMap() local text = (isPlayerMapVisible() and "You are currently viewing your map!") or "Your map is not visible!" outputChatBox(text, 255, 255, 0) -- output text end addCommandHandler("map", checkMap) -- add '/map' command to the check
Click to collapse [-]
Example 2function showMap() if isPlayerMapVisible() then outputChatBox("Player-map closed", 0, 255, 0) forcePlayerMap(false) else outputChatBox("Viewing player-map", 0, 255, 0) forcePlayerMap(true) end end addCommandHandler("showmap", showMap)
See Also
- getLocalPlayer
- getPlayerMapBoundingBox
- getPlayerMapOpacity
- isPlayerMapVisible
- resetBlurLevel
- isPlayerHudComponentVisible
- Shared
- getPlayerTeam
- getPlayerBlurLevel
- setPlayerBlurLevel
- getPlayerSerial
- forcePlayerMap
- getPlayerScriptDebugLevel
- getPlayerFromName
- getPlayerMoney
- getPlayerName
- getPlayerNametagColor
- getPlayerNametagText
- getPlayerPing
- getPlayerWantedLevel
- givePlayerMoney
- isPlayerMapForced
- isPlayerNametagShowing
- setPlayerHudComponentVisible
- setPlayerMoney
- setPlayerNametagColor
- setPlayerNametagShowing
- setPlayerNametagText
- takePlayerMoney
- countPlayersInTeam
- getPlayersInTeam
- isVoiceEnabled
- setControlState
- getControlState