KillPlayer
Jump to navigation
Jump to search
This function kills the specified player.
Syntax
bool killPlayer ( player thePlayer, [ player theKiller = nil, int weapon=255, int bodyPart=255 ] )
Required Arguments
- thePlayer: The player to kill
Optional Arguments
- theKiller: The player responsible for the kill
- weapon: The ID of the weapon that should appear to have killed the player (doesn't affect how they die)
- bodyPart: The ID of the body part that should appear to have been hit by the weapon (doesn't affect how they die)
Returns
Returns true if the player was killed, false if the player specified could not be killed or is invalid.
Example
-- Get the player with an ID of 1 player = getPlayerFromID ( 1 ) -- If a player was found with an ID of 1 then if ( player ) then -- Kill the player if ( killPlayer ( player ) ) then -- Inform everyone that they were killed. outputChatBox ( ( getPlayerName ( player ), " was eliminated." ) ) end end
See Also
- getPlayerTeam
- getPlayerBlurLevel
- setPlayerBlurLevel
- getPlayerSerial
- forcePlayerMap
- getPlayerScriptDebugLevel
- getPlayerFromName
- getPlayerMoney
- getPlayerName
- getPlayerNametagColor
- getPlayerNametagText
- getPlayerPing
- getPlayerWantedLevel
- givePlayerMoney
- isPlayerMapForced
- isPlayerNametagShowing
- setPlayerHudComponentVisible
- setPlayerMoney
- setPlayerNametagColor
- setPlayerNametagShowing
- setPlayerNametagText
- takePlayerMoney
- countPlayersInTeam
- getPlayersInTeam
- isVoiceEnabled
- setControlState
- getControlState