IsCursorShowing

From Multi Theft Auto: Wiki
Revision as of 22:05, 12 August 2007 by Jbeta (talk | contribs) (Added template, sections)
Jump to navigation Jump to search

This function is used to determine whether or not a player's cursor is showing.

Note that this retrieves the cursor state that has been set using showCursor, and thus doesn't take into account the cursor shown while the chatbox, menu or console are open. Also, keep in mind that while the client is aware of cursor states set from the server, the server doesn't know about cursor states set from the client.

Syntax

Click to expand [+]
Server
Click to expand [+]
Client

Example

Click to collapse [-]
Example

This serverside function toggles a player's cursor state.

function toggleCursor ( thePlayer )
	local currentState = isCursorShowing ( thePlayer ) -- get the current cursor state as a boolean
	local oppositeState = not currentState -- get the new state as its logical opposite
	showCursor ( thePlayer, oppositeState ) -- set it as the new cursor state
end

See Also