IsPlayerMapVisible: Difference between revisions
Jump to navigation
Jump to search
Gravestone (talk | contribs) |
Gravestone (talk | contribs) |
||
Line 11: | Line 11: | ||
==Example== | ==Example== | ||
<syntaxhighlight lang="lua"> | <section name="Example 1" class="client" show="true"><syntaxhighlight lang="lua"> | ||
function checkMap() | function checkMap() | ||
if isPlayerMapVisible() then -- check if the player has his map visible | if isPlayerMapVisible() then -- check if the player has his map visible | ||
Line 20: | Line 20: | ||
end | end | ||
addCommandHandler("map", checkMap) -- add '/map' command to the check | addCommandHandler("map", checkMap) -- add '/map' command to the check | ||
</syntaxhighlight> | </syntaxhighlight></section> | ||
<syntaxhighlight lang="lua"> | |||
<section name="Example 2" class="client" show="true"><syntaxhighlight lang="lua"> | |||
function showMap() | function showMap() | ||
if isPlayerMapVisible() then | if isPlayerMapVisible() then | ||
Line 32: | Line 33: | ||
end | end | ||
addCommandHandler("showmap", showMap) | addCommandHandler("showmap", showMap) | ||
</syntaxhighlight> | </syntaxhighlight></section> | ||
==See Also== | ==See Also== | ||
{{Client player functions}} | {{Client player functions}} |
Revision as of 14:36, 9 October 2016
Script Example Missing Function IsPlayerMapVisible needs a script example, help out by writing one. | |
Before submitting check out Editing Guidelines Script Examples. |
This function checks if the local player has their map showing
Syntax
bool isPlayerMapVisible ()
Returns
Returns true if the player has the map visible, false otherwise.
Example
Click to collapse [-]
Example 1function checkMap() if isPlayerMapVisible() then -- check if the player has his map visible outputChatBox("You are currently viewing your map!", 255, 255, 0) -- output text if it's visible else outputChatBox("Your map is not visible!", 255, 255, 0) -- output text if it's not visible end end addCommandHandler("map", checkMap) -- add '/map' command to the check
Click to collapse [-]
Example 2function showMap() if isPlayerMapVisible() then outputChatBox("Radar closed", 0, 255, 0) forcePlayerMap(false) else outputChatBox("Viewing radar", 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