Squirrel/Client/Functions/Vehicles/Gear
From Liberty Unleashed Wiki
(Difference between revisions)
Line 13: | Line 13: | ||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | function | + | 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/ | + | 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
This Vehicle class member returns the gear of the vehicle.
[edit] Syntax
int Vehicle.Gear
[edit] Arguments
- none
[edit] Example: Returning the value
function onClientCommand( szCommand, szText ) { if ( szCommand == "gear" ) { local pPlayer = FindLocalPlayer(); if ( pPlayer.Vehicle ) Message( "Current vehicle gear: " + pPlayer.Vehicle.Gear); } return 1; }
[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
- FindVehicle
- GetVehicleIDFromName
- GetVehicleName
- Vehicle.Airborne
- Vehicle.Angle
- Vehicle.Colour1
- Vehicle.Colour2
- Vehicle.Driver
- Vehicle.EngineDamage
- Vehicle.EngineState
- Vehicle.Gear
- Vehicle.GetAddon
- Vehicle.Health
- Vehicle.ID
- Vehicle.LightState
- Vehicle.Locked
- Vehicle.Model
- Vehicle.Pos
- Vehicle.Radio
- Vehicle.Siren
- Vehicle.Velocity
- Vehicle.VirtualWorld
- Vehicle.Wrecked