Squirrel/Server/Functions/Vehicles/Wrecked
From Liberty Unleashed Wiki
(Difference between revisions)
m (Forgot title) |
(→Example) |
||
Line 12: | Line 12: | ||
== Example == | == Example == | ||
− | |||
− | |||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | - | + | function onPlayerCommand( pPlayer, szCommand, szText ) |
+ | { | ||
+ | if ( szCommand == "wrecked" ) | ||
+ | { | ||
+ | local pVehicle = FindVehicle( 0 ); | ||
+ | if ( pVehicle ) MessagePlayer( "Vehicle ID (0) wrecked status is currently - " + pVehicle.Wrecked, 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. | |
== Related Functions == | == Related Functions == | ||
{{Squirrel/Server/Functions/Vehicles}} | {{Squirrel/Server/Functions/Vehicles}} |
Latest revision as of 17:46, 29 September 2010
This Vehicle class member returns whether the vehicle has been wrecked (aka. it has not yet respawned after its destruction).
[edit] Syntax
bool Vehicle.Wrecked
[edit] Arguments
- none
[edit] Example
function onPlayerCommand( pPlayer, szCommand, szText ) { if ( szCommand == "wrecked" ) { local pVehicle = FindVehicle( 0 ); if ( pVehicle ) MessagePlayer( "Vehicle ID (0) wrecked status is currently - " + pVehicle.Wrecked, 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