onPlayerAction

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

This is called when a player sends a /me action to the chat. This event is still called if the player is muted.

Syntax

  1. function onPlayerAction( Player player, string message )

Arguments

  • player - The player pointer
  • message - The "action" that the player did with /me

Returns

  • 1 - Send the action message to other clients, unless they're muted
  • 0 - Returning 0 will cancel this message and mute the player

Example

This example will kill the player if/when they type /me died.

  1.  
  2. function onPlayerAction( player, text )
  3. {
  4. if ( text == "died" )
  5. {
  6. // Kill the player >:D
  7. player.Health = 0;
  8. MessagePlayer( "You asked for it", player );
  9. }
  10. return 1;
  11. }
  12.  

Notes

The functions MessagePlayer and Player.Health were used in this example. More info about them can be found in the corresponding pages.

Related Events

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox