onPlayerPart

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 remote player leaves the server

Syntax

  1. function onPlayerPart( player, reasonid )

Arguments

  • player - The pointer to the player that left
  • reasonid - The reason ID for the part

Returns

  • 1 - Allows the PlayerPart message appear as normal
  • 0 - Stops the part message being printed to the chatbox. Useful to override it.

Example

This example overrides the default output with our own customizable one.

  1.  
  2. function onPlayerPart(player,reason)
  3. {
  4. // Output our custom message
  5. Message("* " + player.Name + " has left the server.",255,0,0);
  6. // Prevent the default message being output
  7. return 0;
  8. }
  9.  

Notes

The function Message was used in in this example. More info about this in the corresponding page.

Related Events

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox