onPlayerKill

From Liberty Unleashed Wiki
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This event is called when a player kills another player.

Syntax

  1. 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.

  1.  
  2. function onPlayerKill( killer, player, reason, bodypart )
  3. {
  4. Message( "* " + killer.Name + " killed " + player.Name + " (" + GetWeaponName( reason ) + ")" );
  5. return 1;
  6. }
  7.  

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

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox