IT/showCursor: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 32: Line 32:
Questo esempio attiva il cursore per un player di nome "Atti", quindi invia un messaggio se è stato attivato con successo.
Questo esempio attiva il cursore per un player di nome "Atti", quindi invia un messaggio se è stato attivato con successo.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
local thePlayer = getPlayerFromNick ( "Atti" )              -- ottiene il player di nome Dave
local thePlayer = getPlayerFromNick ( "Atti" )              -- ottiene il player di nome Atti
if thePlayer then                                          -- se lo abbiamo ottenuto
if thePlayer then                                          -- se lo abbiamo ottenuto
     showCursor ( thePlayer, true )                          -- gli mostriamo il cursore
     showCursor ( thePlayer, true )                          -- gli mostriamo il cursore
Line 51: Line 51:
</syntaxhighlight>
</syntaxhighlight>
</section>
</section>


==See Also==
==See Also==
{{IT/Funzioni_cursore}}
{{IT/Funzioni_cursore}}

Revision as of 00:22, 11 June 2008

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

Template:IT/Funzioni cursore