Squirrel/Client/Events/Player/onClientKill
From Liberty Unleashed Wiki
(Difference between revisions)
(Created page with '{{Squirrel/Title|onClientKill}} This event is called when the local player kills somebody else. == Syntax == <code>function onClientKill( player, weapon, bodypart )</code> ===…') |
(Added an example.) |
||
Line 18: | Line 18: | ||
== Example == | == Example == | ||
− | + | This example outputs a message whenever you kill another player. | |
− | + | ||
− | + | ||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | + | function onClientKill( player, weapon, bodypart ) | |
+ | { | ||
+ | // Output who you killed | ||
+ | Message( "* You just killed " + player.Name + "!", 255, 0, 0 ); | ||
+ | |||
+ | return 1; | ||
+ | } | ||
</code> | </code> | ||
Latest revision as of 23:47, 27 September 2011
This event is called when the local player kills somebody else.
[edit] Syntax
function onClientKill( player, weapon, bodypart )
[edit] Arguments
- player - The pointer to the player that was killed
- weapon - The weapon used
- bodypart - The bodypart that was hit
[edit] Returns
This event does not handle return values.
[edit] Example
This example outputs a message whenever you kill another player.
function onClientKill( player, weapon, bodypart ) { // Output who you killed Message( "* You just killed " + player.Name + "!", 255, 0, 0 ); return 1; }
[edit] Notes
-- List of used functions and other notes here.
[edit] Related Events
- onClientArmourChange
- onClientCashChange
- onClientCollideWithPlayer
- onClientCommand
- onClientDeath
- onClientFall
- onClientHealthChange
- onClientHurt
- onClientKill
- onClientKeyStateChange
- onClientRequestClass
- onClientRequestSpawn
- onClientShot
- onClientSpawn
- onClientUseDetonator
- onClientWeaponChange
- onPlayerDeath
- onPlayerJoin
- onPlayerKill
- onPlayerPart
- onPlayerSpawn