Squirrel/Server/Functions/Vehicles/Model
From Liberty Unleashed Wiki
(Difference between revisions)
(Created page with '{{Squirrel/Title|Vehicle.Model}} __NOTOC__ This ''Vehicle'' class member returns the Model of the given vehicle. == Syntax == <code>Integer vehicle.Model</code> == Example == …') |
|||
Line 4: | Line 4: | ||
== Syntax == | == Syntax == | ||
− | <code>Integer | + | <code>Integer Vehicle.Model</code> |
== Example == | == Example == | ||
− | + | This returns the model ID of vehicle ID 0. | |
− | + | ||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | + | function onPlayerCommand( pPlayer, szCommand, szText ) | |
+ | { | ||
+ | if ( szCommand == "model" ) | ||
+ | { | ||
+ | local pVehicle = FindVehicle( 0 ); | ||
+ | if ( pVehicle ) MessagePlayer( "Vehicle ID 0's model ID is " + pVehicle.Model, pPlayer ); | ||
+ | } | ||
+ | |||
+ | return 1; | ||
+ | } | ||
</code> | </code> | ||
=== Notes === | === Notes === | ||
− | + | The functions [[Squirrel/Server/Functions/Messages/MessagePlayer|MessagePlayer]] and [[Squirrel/Server/Functions/Vehicles/FindVehicle|FindVehicle]] and event [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] were used in this example. More info about them in the corresponding pages. | |
Latest revision as of 17:38, 25 October 2010
This Vehicle class member returns the Model of the given vehicle.
[edit] Syntax
Integer Vehicle.Model
[edit] Example
This returns the model ID of vehicle ID 0.
function onPlayerCommand( pPlayer, szCommand, szText ) { if ( szCommand == "model" ) { local pVehicle = FindVehicle( 0 ); if ( pVehicle ) MessagePlayer( "Vehicle ID 0's model ID is " + pVehicle.Model, pPlayer ); } return 1; }
[edit] Notes
The functions MessagePlayer and FindVehicle and event onPlayerCommand were used in this example. More info about them in the corresponding pages.
[edit] Related Functions
- CreateVehicle
- FindVehicle
- GetClosestVehicle
- GetVehicleCount
- GetVehicleHandlingData
- GetVehicleIDFromName
- GetVehicleName
- SetVehicleHandlingData
- Vehicle.Alpha
- Vehicle.Angle
- Vehicle.Colour1
- Vehicle.Colour2
- Vehicle.Driver
- Vehicle.EngineDamage
- Vehicle.Explode
- Vehicle.Fix
- Vehicle.GetAddon
- Vehicle.GetPassenger
- Vehicle.GetHandlingData
- Vehicle.GetWheelStatus
- Vehicle.Health
- Vehicle.ID
- Vehicle.IdleRespawnTime
- Vehicle.IdleTime
- Vehicle.LightState
- Vehicle.Locked
- Vehicle.Marker
- Vehicle.MarkerScale
- Vehicle.MarkerSprite
- Vehicle.Model
- Vehicle.OneTime
- Vehicle.PassengerCount
- Vehicle.Pos
- Vehicle.Remove
- Vehicle.Respawn
- Vehicle.RespawnTime
- Vehicle.RGBColour1
- Vehicle.RGBColour2
- Vehicle.SetHandlingData
- Vehicle.SetWheelStatus
- Vehicle.SpawnAngle
- Vehicle.SpawnPos
- Vehicle.SetAddon
- Vehicle.SetEngineState
- Vehicle.SetRadio
- Vehicle.Siren
- Vehicle.SirenLight
- Vehicle.TaxiLight
- Vehicle.Velocity
- Vehicle.VirtualWorld
- Vehicle.Wrecked