isPlayerCrosshairVisible | Multi Theft Auto: Wiki Skip to content

isPlayerCrosshairVisible

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function checks if the local player has showing crosshair.

Note

This function checks if the crosshair is rendered by GTA. Please note that hud components are not associated with this function, so the function may return true even if the "crosshair" component is hidden with setPlayerHudComponentVisible . If you need checking use isPlayerHudComponentVisible .

Syntax

isPlayerCrosshairVisible ( )

Code Examples

client
addCommandHandler("crosshair", function()
local crosshairStatus = isPlayerCrosshairVisible() and "visible" or "hidden"
outputChatBox("Your crosshair is: "..crosshairStatus)
end)

See Also