Squirrel/Server/Events/Player/onPlayerPart

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
This is called when a player joins the server. This is fired ''after'' files and data has been sent to the client
+
This is called when a player joins the server. This is fired ''after'' files and data has been sent to the client.
  
 
== Syntax ==
 
== Syntax ==
  
<code>function OnPlayerPart( player, reason )</code>
+
<code>function onPlayerPart( Player player, int reason )</code>
  
 
== Parameters ==
 
== Parameters ==
  
 
* '''player''' - The pointer of the new player
 
* '''player''' - The pointer of the new player
* '''reason''' - The reason ID for the part
+
* '''reason''' - The [[Squirrel/Server/Constants#Part_Reasons|reason ID]] for the part
  
 
== Example ==
 
== Example ==
Line 16: Line 16:
  
 
<code lang="squirrel">
 
<code lang="squirrel">
function OnPlayerPart( player, reason )
+
function onPlayerPart( player, reason )
 
{
 
{
 
     Message( player.Name + " left the server" );
 
     Message( player.Name + " left the server" );
Line 24: Line 24:
 
=== Notes ===
 
=== Notes ===
  
The function [[Squirrel/Functions/Misc/MessagePlayer|MessagePlayer]] was used in in this example. More info about it in the corresponding page.
+
The function [[Squirrel/Server/Functions/Messages/MessagePlayer|MessagePlayer]] was used in in this example. More info about it in the corresponding page.
  
 
== Related Functions ==
 
== Related Functions ==
  
{{Squirrel/Events/Player}}
+
{{Squirrel/Server/Events/Player}}

Revision as of 06:28, 13 December 2009

This is called when a player joins the server. This is fired after files and data has been sent to the client.

Syntax

  1. function onPlayerPart( Player player, int reason )

Parameters

  • player - The pointer of the new player
  • reason - The reason ID for the part

Example

This will say <name> left the server when a player leaves the server

  1.  
  2. function onPlayerPart( player, reason )
  3. {
  4. Message( player.Name + " left the server" );
  5. }
  6.  

Notes

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

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox