IT/isPlayerDead

From Multi Theft Auto: Wiki
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.
« Torna alla Pagina principale italiana .


Questa funzione verifica se un giocatore è morto o meno.

Sintassi

bool isPlayerDead ( player thePlayer )

Argomenti richiesti

  • thePlayer: Il player di cui vuoi verificare la morte.

Valori restituiti

Restituisce true se il player è morto, altrimenti false.

Esempio

Click to collapse [-]
Server

Questo esempio permette a un giocatore di usare il comando 'sonomorto' per verificare se sia morto o meno.

--Verifica se il giocatore è morto meno e mostra un messaggio nella chatbox
function verificaMorte ( thePlayer, commandName )
    if ( isPlayerDead ( thePlayer ) ) then
         outputChatBox ( "Sei morto, preparati a diventare uno zombie!", thePlayer )
    else
         outputChatBox ( "Tira pure un sospiro di sollievo, sei vivo.", thePlayer )
    end
end
addCommandHandler ( "sonomorto", verificaMorte )
Click to collapse [-]
Client

Questo esempio permette a un giocatore di usare il comando 'sonomorto' per verificare se sia morto o meno.

--Check if player is alive or dead and let them know in the chat box
function verificaMorte ( commandName )
    if ( isPlayerDead ( getLocalPlayer() ) ) then
         outputChatBox ( "Sei morto, preparati a diventare uno zombie!", getLocalPlayer() )
    else
         outputChatBox ( "Tira pure un sospiro di sollievo, sei vivo.", getLocalPlayer() )
    end
end
addCommandHandler ( "sonomorto", verificaMorte )

Vedere anche