Squirrel/Server/Events/Vehicle/onPlayerExitedTrain

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Documenting a function)
 
(Added an argument which will be added in the next update, fixed title)
 
Line 1: Line 1:
{{Squirrel/Title|onPlayerEnteredVehicle}}
+
{{Squirrel/Title|onPlayerExitedTrain}}
 +
{{Squirrel/LUOnly}}
 +
{{ScriptingChangesIn0.1.0.10}}
 +
{{ScriptingChangesIn0.1.0.11}}
 
This is called when a player has successfully exited a train.
 
This is called when a player has successfully exited a train.
  
 
== Syntax ==
 
== Syntax ==
  
<code>function onPlayerExitedTrain( Player player )</code>
+
<code>function onPlayerExitedTrain( Player player, int train )</code>
  
 
=== Arguments ===
 
=== Arguments ===
  
 
* '''player''' - The player who exited a train
 
* '''player''' - The player who exited a train
 +
* '''train''' - The ID of the train the player exited. '''NOTE:''' This argument was added in update 0.1.0.11, so it is not present in previous versions
  
 
=== Returns ===
 
=== Returns ===
Line 19: Line 23:
  
 
<code lang="squirrel">
 
<code lang="squirrel">
function onPlayerExitedTrain( player )
+
function onPlayerExitedTrain( player, train )
 
{
 
{
 
     MessagePlayer( "You exited a train.", player );
 
     MessagePlayer( "You exited a train.", player );

Latest revision as of 18:06, 9 September 2011

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events
LU This function works in Liberty Unleashed only.

This is called when a player has successfully exited a train.

[edit] Syntax

  1. function onPlayerExitedTrain( Player player, int train )

[edit] Arguments

  • player - The player who exited a train
  • train - The ID of the train the player exited. NOTE: This argument was added in update 0.1.0.11, so it is not present in previous versions

[edit] Returns

This event does not handle return values.

[edit] Example

This example will message a player when they exit a train.

  1.  
  2. function onPlayerExitedTrain( player, train )
  3. {
  4. MessagePlayer( "You exited a train.", player );
  5. return 1;
  6. }
  7.  

[edit] Notes

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

[edit] Related Events

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox