Squirrel/Server/Events/Player/onPlayerKill
From Liberty Unleashed Wiki
(Difference between revisions)
m (→Example) |
|||
Line 24: | Line 24: | ||
function onPlayerKill( killer, player, reason, bodypart ) | function onPlayerKill( killer, player, reason, bodypart ) | ||
{ | { | ||
− | Message( "* " + killer.Name + " killed " + player.Name " (" + GetWeaponName( reason ) + ")" ); | + | Message( "* " + killer.Name + " killed " + player.Name + " (" + GetWeaponName( reason ) + ")" ); |
return 1; | return 1; |
Latest revision as of 17:06, 12 February 2012
This event is called when a player kills another player.
[edit] Syntax
function onPlayerKill( Player pKiller, Player pPlayer, int iWeapon, int iBodyPart )
[edit] 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
[edit] Returns
This event does not handle return values.
[edit] 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; }
[edit] Notes
The functions Message, Player.Name and GetWeaponName were used in this example. More info about them can be found in the corresponding pages.
[edit] Related Functions
- onPlayerAction
- onPlayerArmourChange
- onPlayerCashChange
- onPlayerChat
- onPlayerCommand
- onPlayerConnect
- onPlayerDeath
- onPlayerFall
- onPlayerHealthChange
- onPlayerIslandChange
- onPlayerJoin
- onPlayerKeyStateChange
- onPlayerKill
- onPlayerPart
- onPlayerScoreChange
- onPlayerSkinChange
- onPlayerSpawn
- onPlayerUpdate
- onPlayerTeamChange
- onPlayerUseDetonator
- onPlayerVirtualWorldChange
- onPlayerWeaponChange