Squirrel/Server/Functions/Players/VehicleSeat

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with '{{Squirrel/Title|Player.VehicleSeat}} This function returns the seat that the player is sat in. == Syntax == <code>int player.VehicleSeat</code> == Arguments == * '''none''' …')
 
 
Line 12: Line 12:
 
== Example ==
 
== Example ==
  
{{Squirrel/NeedsExample}}
+
This will tell the player what seat they are currently sat in when they type '/seat'.
Explanation for the example
+
  
 
<code lang="squirrel">
 
<code lang="squirrel">
-- todo
+
function onPlayerCommand( pPlayer, szCommand, szText )
 +
{
 +
if ( szCommand == "seat" )
 +
{
 +
if ( pPlayer.Vehicle ) MessagePlayer( "Your current vehicle seat is - " + pPlayer.VehicleSeat, pPlayer );
 +
}
 +
 +
return 1;
 +
}
 
</code>
 
</code>
  
 
=== Notes ===
 
=== Notes ===
  
-- List of used functions and other notes here.
+
The function [[Squirrel/Server/Functions/Messages/MessagePlayer|MessagePlayer]] and event [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] were used in this example. More info about them in the corresponding pages.
  
 
== Related Functions ==
 
== Related Functions ==
  
 
{{Squirrel/Server/Functions/Players}}
 
{{Squirrel/Server/Functions/Players}}

Latest revision as of 16:20, 25 October 2010

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function returns the seat that the player is sat in.

[edit] Syntax

  1. int player.VehicleSeat

[edit] Arguments

  • none

[edit] Example

This will tell the player what seat they are currently sat in when they type '/seat'.

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "seat" )
  5. {
  6. if ( pPlayer.Vehicle ) MessagePlayer( "Your current vehicle seat is - " + pPlayer.VehicleSeat, pPlayer );
  7. }
  8. return 1;
  9. }
  10.  

[edit] Notes

The function MessagePlayer and event onPlayerCommand were used in this example. More info about them in the corresponding pages.

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox