Scripting/Squirrel/Functions/Vehicles/Fix
From VC-MP Wiki
NOTE: This function has been added in VC:MP 0.3z r2. It will not work in previous versions.
This function will fix the visual damage of the vehicle and restore the vehicle health.
Syntax
bool vehicle.Fix()
Arguments
- none
Example
This command will fix your vehicle when you do "/c fix"
function onPlayerCommand( player, cmd, text ) if ( cmd == "fix" ) { local veh = player.Vehicle; if ( veh ) { MessagePlayer( "Your vehicle has been fixed.", player ); veh.Fix(); } else MessagePlayer( "You must be in the vehicle you want to fix.", player ); } }
Notes
The function MessagePlayer and call onPlayerCommand were used in in this example. More info about them in the corresponding pages.
Related Functions
- CreateVehicle
- FindVehicle
- GetVehicleCount
- GetVehicleModelFromName
- GetVehicleNameFromModel
- Vehicle.Alarm
- Vehicle.Angle
- Vehicle.Colour1
- Vehicle.Colour2
- Vehicle.Driver
- Vehicle.Fix
- Vehicle.Health
- Vehicle.ID
- Vehicle.IsLocked
- Vehicle.KillEngine
- Vehicle.Lights
- Vehicle.Model
- Vehicle.Pos
- Vehicle.Respawn
- Vehicle.RespawnAs
- Vehicle.RespawnAt
- Vehicle.SetFlatTyres
- Vehicle.SpawnPos
- Vehicle.SpawnAngle
- Vehicle.Velocity
- Vehicle.Remove
