Squirrel/Server/Events/Player/onPlayerKill
From Liberty Unleashed Wiki
(Difference between revisions)
m (my memory sucks) |
|||
Line 4: | Line 4: | ||
== Syntax == | == Syntax == | ||
− | <code>function onPlayerKill( Player | + | <code>function onPlayerKill( Player pKiller, Player pPlayer, int iWeapon, int iBodyPart )</code> |
=== Arguments === | === 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 [[Squirrel/Server/Constants#Weapons.2FDeath_Reasons|here]] | * '''iWeapon''' - The ID of the weapon used to kill the player - check list [[Squirrel/Server/Constants#Weapons.2FDeath_Reasons|here]] | ||
* '''iBodyPart''' - The part of the body which was hit - check list [[Squirrel/Server/Constants#Body_Parts|here]] | * '''iBodyPart''' - The part of the body which was hit - check list [[Squirrel/Server/Constants#Body_Parts|here]] |
Revision as of 17:02, 11 August 2011
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