Squirrel/Client/Functions/Vehicles/Gear

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
 
Line 13: Line 13:
  
 
<code lang="squirrel">
 
<code lang="squirrel">
function onPlayerCommand( szCommand, szText )
+
function onClientCommand( szCommand, szText )
 
{
 
{
 
if ( szCommand == "gear" )
 
if ( szCommand == "gear" )
Line 27: Line 27:
 
=== Notes ===
 
=== Notes ===
  
The functions [[Squirrel/Client/Functions/Messages/Message|Message]] and [[Squirrel/Client/Functions/Players/FindLocalPlayer |FindLocalPlayer ]] and event [[Squirrel/Client/Events/Player/onPlayerCommand|onPlayerCommand]] were used in this example. More info about them in the corresponding pages.
+
The functions [[Squirrel/Client/Functions/Messages/Message|Message]] and [[Squirrel/Client/Functions/Players/FindLocalPlayer|FindLocalPlayer ]] and event [[Squirrel/Client/Events/Player/onClientCommand|onClientCommand]] were used in this example. More info about them in the corresponding pages.
  
 
== Related Functions ==
 
== Related Functions ==
  
 
{{Squirrel/Client/Functions/Vehicles}}
 
{{Squirrel/Client/Functions/Vehicles}}

Latest revision as of 01:16, 17 August 2011

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

This Vehicle class member returns the gear of the vehicle.

[edit] Syntax

  1. int Vehicle.Gear

[edit] Arguments

  • none

[edit] Example: Returning the value

  1.  
  2. function onClientCommand( szCommand, szText )
  3. {
  4. if ( szCommand == "gear" )
  5. {
  6. local pPlayer = FindLocalPlayer();
  7. if ( pPlayer.Vehicle ) Message( "Current vehicle gear: " + pPlayer.Vehicle.Gear);
  8. }
  9. return 1;
  10. }
  11.  

[edit] Notes

The functions Message and FindLocalPlayer and event onClientCommand were used in this example. More info about them in the corresponding pages.

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox