Squirrel/Client/Events/Player/onClientKill

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(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 ==
  
Some explanation here
+
This example outputs a message whenever you kill another player.
{{Squirrel/NeedsExample}}
+
 
+
 
<code lang="squirrel">
 
<code lang="squirrel">
-- todo
+
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

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This event is called when the local player kills somebody else.

[edit] Syntax

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

  1.  
  2. function onClientKill( player, weapon, bodypart )
  3. {
  4. // Output who you killed
  5. Message( "* You just killed " + player.Name + "!", 255, 0, 0 );
  6. return 1;
  7. }
  8.  

[edit] Notes

-- List of used functions and other notes here.

[edit] Related Events

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox