IsPlayerCrosshairVisible

From Multi Theft Auto: Wiki
Revision as of 19:16, 30 September 2024 by FileEX (talk | contribs) (Created page with "__NOTOC__ {{Client function}} {{New feature/item|3.0161|1.6.0|22751|This function checks if the local player has showing crosshair.}} {{Note|This function always returns true for '''spraycan''' and '''fire extinguisher'''.}} ==Syntax== <syntaxhighlight lang="lua">bool isPlayerCrosshairVisible()</syntaxhighlight> ===Returns=== Returns ''true'' if the player has the crosshair visible, ''false'' otherwise. ==Example== <syntaxhighlight lang="lua"> function check() out...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

ADDED/UPDATED IN VERSION 1.6.0 r22751:
This function checks if the local player has showing crosshair.
[[{{{image}}}|link=|]] Note: This function always returns true for spraycan and fire extinguisher.

Syntax

bool isPlayerCrosshairVisible()

Returns

Returns true if the player has the crosshair visible, false otherwise.

Example

function check()
   outputChatBox("Crosshair: "..(isPlayerCrosshairVisible() and "visible" or "not visible", 255, 255, 0) -- output text 
end
addCommandHandler("crosshair", check)

See Also