IT/showCursor

From Multi Theft Auto: Wiki
Revision as of 00:23, 11 June 2008 by Atti (talk | contribs) (→‎See Also)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Questa funzione è usata per mostrare o nascondere il cursore di un giocatore.

Nota che, indipendentemente dallo stato del cursore impostato da questa funzione, il cursore sarà sempre visibile quando la chatbox o il menu sono aperti.

Sintassi

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

Argomenti richiesti

  • thePlayer: Il giocatore di cui vuoi mostrare o nascondere il cursore.
  • show: Un valore booleano che determina se mostrare (true) o nascondere (false) il cursore.
Click to collapse [-]
Client
bool showCursor ( bool show )

Argomenti richiesti

  • show: Un valore booleano che determina se mostrare (true) o nascondere (false) il cursore.

Valori restituiti

Restituisce true se il cursore del giocatore è stato mostrato o nascosto con successo, altrimenti false.

Esempio

Click to collapse [-]
Server

Questo esempio attiva il cursore per un player di nome "Atti", quindi invia un messaggio se è stato attivato con successo.

local thePlayer = getPlayerFromNick ( "Atti" )              -- ottiene il player di nome Atti
if thePlayer then                                           -- se lo abbiamo ottenuto
    showCursor ( thePlayer, true )                          -- gli mostriamo il cursore
    if isCursorShowing ( thePlayer ) then                   -- ha funzionato?
        outputChatBox ( "Il cursore è ora attivo per Atti!" ) -- invia un messaggio nella chatbox
    end
end
Click to collapse [-]
Client

Questo esempio attiva il cursore per il client attivo, quindi invia un messaggio in chatbox.

showCursor ( true )                          -- mostriamo il cursore
if isCursorShowing ( ) then                   -- ha funzionato?
    outputChatBox ( "Il cursore è ora attivo per "..getPlayerName( getLocalPlayer() ).."!" ) -- invia un messaggio nella chatbox
end

See Also