Shared function
showCursor
This function is used to show or hide a player's cursor.
Syntax
bool showCursor ( player thePlayer, bool show, bool toggleControls )
- player thePlayer : The player you want to show or hide the cursor of.
- bool show : A boolean value determining whether to show (true) or hide (false) the cursor.
- bool toggleControls : A boolean value determining whether to disable controls whilst the cursor is showing. true implies controls are disabled, false implies controls remain enabled.
void ( )
void ( )
Returns
Returns true if the player's cursor was shown or hidden successfully, false otherwise.
- bool result
Examples
Example 1 (Client-side)
This example shows the cursor all the time
showCursor ( true ) -- Shows cursor
showCursor ( false ) -- Doesnt Show Cursor
Example 2 (Server-side)
This example shows the cursor for a player named "Dave", then outputs a message if it was shown successfully.
local thePlayer = getPlayerFromName ( "Dave" ) -- get the player named Dave
if thePlayer then -- if we got him
showCursor ( thePlayer, true ) -- make his cursor show
if isCursorShowing ( thePlayer ) then -- did it show?
outputChatBox ( "Cursor is now showing for Dave." ) -- print a message to the chat box
end
end
