Squirrel/Server/Events/Player/onPlayerJoin

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(updated)
Line 4: Line 4:
 
== Syntax ==
 
== Syntax ==
  
<code>function OnPlayerJoin( player )</code>
+
<code>function onPlayerJoin( player )</code>
  
 
== Parameters ==
 
== Parameters ==
Line 15: Line 15:
  
 
<code lang="squirrel">
 
<code lang="squirrel">
function OnPlayerJoin( player )
+
function onPlayerJoin( player )
 
{
 
{
     MessagePlayer( "Welcome " + player.Name + " to the server!", id );
+
     MessagePlayer( "Welcome " + player.Name + " to the server!", player );
 
}
 
}
 
</code>
 
</code>
Line 23: Line 23:
 
=== 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:26, 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 onPlayerJoin( player )

Parameters

  • player - The pointer of the new player

Example

This will say Hello to the player when they join the server

  1.  
  2. function onPlayerJoin( player )
  3. {
  4. MessagePlayer( "Welcome " + player.Name + " to the server!", player );
  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