ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. showCursor

Function

showCursor

Server and clientMiscellaneousIdentical to MTA:SA

Shows or hides the mouse cursor. The cursor stays visible while at least one resource wants it, so hiding it in one resource does not close another's cursor. By default, while the cursor is shown, the ped controls are blocked.

Syntax

Server

bool showCursor(player thePlayer, bool show [, bool toggleControls = true])

Client

bool showCursor(bool show [, bool toggleControls = true])

Arguments

thePlayerplayer
A player or root (server only).
showbool
true = show.
toggleControlsbool, optional = true
true = block controls while the cursor is visible.

Returns

true on success.

Example

bindKey("m", "down", function()
    showCursor(not isCursorShowing())
end)

See also