HU/showCursor

From Multi Theft Auto: Wiki
Revision as of 11:05, 13 October 2018 by Surge (talk | contribs)
Jump to navigation Jump to search

Ez a function a játékos kurzorának a megjelenítésére vagy elrejtésére használható.

[[{{{image}}}|link=|]] Note: Regardless of the cursor state you set using this function, the cursor will always be visible while the menu, the chatbox input line or the console are active, or if another resource has called this function.

Szintaxis

Click to collapse [-]
Server
bool showCursor ( player thePlayer, bool show, [ bool toggleControls = true ] )

Kötelező paraméterek

  • thePlayer: A játékos, akinek a kurzorát megjeleníteni, vagy elrejteni szeretné.
  • show: Egy boolean érték, amely meghatározza, hogy a kurzor meg legyen jelenítve (true), vagy el legyen rejtve (false).

Tetszőleges paraméterek

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.

  • toggleControls: A boolean value determining whether to disable controls whilst the cursor is showing. true implies controls are disabled, false implies controls remain enabled.
Click to collapse [-]
Client
bool showCursor ( bool show, [ bool toggleControls = true ]  )

Kötelező paraméterek

  • show: A boolean value determining whether to show (true) or hide (false) the cursor.

Tetszőleges paraméterek

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.

  • toggleControls: A boolean value determining whether to disable controls whilst the cursor is showing. true implies controls are disabled, false implies controls remain enabled.

Visszatérési érték

Returns true if the player's cursor was shown or hidden successfully, false otherwise.

Példa

Click to collapse [-]
Server

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
Click to collapse [-]
Client

This example shows the cursor all the time

showCursor ( true ) -- Shows cursor
showCursor ( false ) -- Doesnt Show Cursor


Lásd még

Fordította