onPlayerKill
From Liberty Unleashed Wiki
This event is called when a player kills another player.
Syntax
function onPlayerKill( Player pKiller, Player pPlayer, int iWeapon, int iBodyPart )
Arguments
- pKiller - The pointer of the player who killed pPlayer
- pPlayer - The pointer of the player who was killed
- iWeapon - The ID of the weapon used to kill the player - check list here
- iBodyPart - The part of the body which was hit - check list here
Returns
This event does not handle return values.
Example
This will message the chatbox when a player kills another player.
function onPlayerKill( killer, player, reason, bodypart ) { Message( "* " + killer.Name + " killed " + player.Name " (" + GetWeaponName( reason ) + ")" ); return 1; }
Notes
The functions Message, Player.Name and GetWeaponName were used in this example. More info about them can be found in the corresponding pages.
Related Functions
- onPlayerAction
- onPlayerArmourChange
- onPlayerCashChange
- onPlayerChat
- onPlayerCommand
- onPlayerConnect
- onPlayerDeath
- onPlayerFall
- onPlayerHealthChange
- onPlayerIslandChange
- onPlayerJoin
- onPlayerKeyStateChange
- onPlayerKill
- onPlayerPart
- onPlayerScoreChange
- onPlayerSkinChange
- onPlayerSpawn
- onPlayerUpdate
- onPlayerTeamChange
- onPlayerUseDetonator
- onPlayerVirtualWorldChange
- onPlayerWeaponChange