IsPlayerCrosshairVisible: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
Line 9: Line 9:


=Return=
=Return=
a
'''Texto em negrito'''true  if the crosshair is visible.
'''false''' if the crosshair is not visible.


=Examples=
=Examples=

Revision as of 21:21, 4 December 2024

ADDED/UPDATED IN VERSION 1.6.0 r22751:
This function checks if the local player has showing crosshair.
[[{{{image}}}|link=|]] 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

bool isPlayerCrosshairVisible()

Return

Texto em negritotrue if the crosshair is visible. false if the crosshair is not visible.

Examples

function aim()

   if isPlayerCrosshairVisible() then
       outputChatBox("your sight is visible")
   else
       outputChatBox("your crosshair is not visible")
   end

end addCommandHandler("aimcheck", aim)

See Also