KillPlayer: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
__NOTOC__
__NOTOC__
==Description==
This function kills the specified player. It returns a boolean value (true or false) depending on whether the function passed or failed.
This function kills the specified player. It returns a boolean value (true or false) depending on whether the function passed or failed.


==Syntax==
==Syntax==
bool [[KillPlayer]] ( player )
<syntaxhighlight lang="lua">bool KillPlayer ( player thePlayer )</syntaxhighlight>


===Required Arguments===
===Required Arguments===
* '''player''': A [[player]] object referencing the specified player
* '''player''': A [[player]] object referencing the specified player.
 
===Returns===
Returns true if the function succeeded, and false otherwise.


==Example==
==Example==
player = [[GetPlayerFromID]] ( 1 )
<syntaxhighlight lang="lua">player = GetPlayerFromID ( 1 )
  if ( [[KillPlayer]] ( player ) )
  if ( KillPlayer ( player ) )
  [[serverChat]] ( [[GetPlayerName]], " was eliminated." )
  outputChatBox ( ( GetPlayerName ( player ), " was eliminated." ), source )
  end
  end</syntaxhighlight>

Revision as of 17:25, 18 May 2006

This function kills the specified player. It returns a boolean value (true or false) depending on whether the function passed or failed.

Syntax

bool KillPlayer ( player thePlayer )

Required Arguments

  • player: A player object referencing the specified player.

Returns

Returns true if the function succeeded, and false otherwise.

Example

player = GetPlayerFromID ( 1 )
 if ( KillPlayer ( player ) )
 outputChatBox ( ( GetPlayerName ( player ), " was eliminated." ), source )
 end