Squirrel/Server/Events/Player/onPlayerKill

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(New page: == Syntax == <code>function onPlayerKill( killer, player, reason )</code> == Parameters == * '''killer''' - The killer pointer * '''player''' - The player pointer * '''reason''' - The I...)

Revision as of 09:21, 9 January 2010

Contents

Syntax

  1. function onPlayerKill( killer, player, reason )

Parameters

  • killer - The killer pointer
  • player - The player pointer
  • reason - The ID of the weapon used to kill the player

Example

This will message the main chat when a player kills another player with an onfoot weapon.

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

Notes

The functions Message, player.Name and GetWeaponName were used in in this example. More info about them can be found in the corresponding pages.


Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox