Squirrel/Server/Events/Vehicle/onPlayerExitedTrain
From Liberty Unleashed Wiki
(Difference between revisions)
(Documenting a function) |
(Added an argument which will be added in the next update, fixed title) |
||
Line 1: | Line 1: | ||
− | {{Squirrel/Title| | + | {{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
This is called when a player has successfully exited a train.
[edit] Syntax
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.
function onPlayerExitedTrain( player, train ) { MessagePlayer( "You exited a train.", player ); return 1; }
[edit] Notes
The function MessagePlayer was used in this example. More info about it can be found in the corresponding page.