IsPlayerMapVisible: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
Line 12: Line 12:
==Example==
==Example==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--todo
function 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
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{Client player functions}}
{{Client player functions}}

Revision as of 14:33, 9 October 2016

Accessories-text-editor.png 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

function 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

See Also