RU/blowVehicle
Эта функция взрывает машину. Взрыв убивает водителя и пассажиров, и может нанести урон находящимся близко к машине.
Синтаксис
bool blowVehicle ( vehicle vehicleToBlow, [ bool explode=true ] )
Синтаксис ООП Помогите! Я не понимаю, что это!
- Метод: vehicle:blow(...)
- Переменная: .blown
- Парная функция: isVehicleBlown
Обязательные аргументы
- vehicleToBlow: машина которая будет взорвана.
Необязательные аргументы
NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.
- explode: если установлено true машина взорвется, в противном случае(false или не указан) произойдет тихий взрыв.
bool blowVehicle ( vehicle vehicleToBlow )
Синтаксис ООП Помогите! Я не понимаю, что это!
- Метод: vehicle:blow(...)
Обязательные аргументы
- vehicleToBlow: машина которая будет взорвана.
Возвращает
Возвращает true в случае успеха, false если указаны неправильные аргументы.
Примеры
This example will blow up every vehicle in the game.
vehicles = getElementsByType ( "vehicle" ) for vehicleKey, vehicleValue in ipairs(vehicles) do blowVehicle ( vehicleValue ) end
It is worth noting that the same could be achieved with the following:
blowVehicle ( root ) -- root (getRootElement) is a built in MTA variable and therefore we do not have to define it.
This example will blow a player's vehicle when he enters the car, like a carbomb.
riggedVehicle = createVehicle(445, 0, 0, 5) function blowVehicleEnter ( thePlayer, seat, jacked ) --ENGINE START BOMB. if seat == 0 then --check if the seat the player got into was id 0 - i.e. driver seat blowVehicle ( source ) --if it was, toast him end end addEventHandler ( "onVehicleEnter", riggedVehicle, blowVehicleEnter ) --trigger the function when a certain vehicle is entered
Пример клиентского класса
Heads up! Client classes only work on MTA 1.4, therefore we highly recommend you to visit Client Scripting Classes first.
This script will create an Infernus at the center (0, 0, 3) of San Andreas upon execution.
addEventHandler( "onClientResourceStart", resourceRoot, function() infernus = Vehicle.create( 411, Vector3( 0, 0, 3 ) ); -- Create an Infernus and spawn it at the middle of SA. infernus:setColor( 0, 0, 0 ); -- Set its color to black. end) addCommandHandler( "blowinfernus", function() if not infernus.blown then -- Check if the Infernus is blown up or not. infernus:blow(); else -- Ouch, it's blown up, let's output an error to the client. outputChatBox( "The Infernus has already been blown up by you.", 255, 0, 0, false ); end end)
Смотрите также
- createVehicle
- addVehicleSirens
- removeVehicleSirens
- removeVehicleUpgrade
- addVehicleUpgrade
- attachTrailerToVehicle
- blowVehicle
- detachTrailerFromVehicle
- fixVehicle
- resetVehicleExplosionTime
- resetVehicleIdleTime
- respawnVehicle
- spawnVehicle
- toggleVehicleRespawn
- isTrainChainEngine
- isTrainDerailable
- isTrainDerailed
- isVehicleBlown
- isVehicleTaxiLightOn
- isVehicleDamageProof
- isVehicleFuelTankExplodable
- isVehicleLocked
- isVehicleOnGround
- getTrainDirection
- getTrainPosition
- getTrainSpeed
- getTrainTrack
- getVehicleColor
- getVehicleCompatibleUpgrades
- getVehicleController
- getVehicleDoorState
- getVehicleEngineState
- getVehicleLandingGearDown
- getVehicleLightState
- getVehicleMaxPassengers
- getVehicleName
- getVehicleOccupant
- getVehicleOccupants
- getVehicleOverrideLights
- getVehiclePaintjob
- getVehiclePanelState
- getVehiclePlateText
- getVehicleSirensOn
- getVehiclesOfType
- getVehicleTowedByVehicle
- getVehicleTowingVehicle
- getVehicleTurnVelocity
- getVehicleTurretPosition
- getVehicleType
- getVehicleUpgradeOnSlot
- getVehicleUpgrades
- getVehicleUpgradeSlotName
- getVehicleWheelStates
- getVehicleDoorOpenRatio
- getVehicleHandling
- getModelHandling
- getOriginalHandling
- getVehicleHeadLightColor
- getVehicleModelFromName
- getVehicleNameFromModel
- getVehicleVariant
- getVehicleSirenParams
- getVehicleSirens
- setModelHandling
- setTrainDerailable
- setTrainDerailed
- setTrainDirection
- setTrainPosition
- setTrainSpeed
- setTrainTrack
- setVehicleColor
- setVehicleDamageProof
- setVehicleDoorState
- setVehicleDoorsUndamageable
- setVehicleEngineState
- setVehicleFuelTankExplodable
- setVehicleIdleRespawnDelay
- setVehicleLandingGearDown
- setVehicleLightState
- setVehicleLocked
- setVehicleOverrideLights
- setVehiclePaintjob
- setVehiclePanelState
- setVehiclePlateText
- setVehicleRespawnDelay
- setVehicleRespawnPosition
- setVehicleSirensOn
- setVehicleTurretPosition
- setVehicleDoorOpenRatio
- setVehicleHandling
- setVehicleTurnVelocity
- setVehicleWheelStates
- setVehicleHeadLightColor
- setVehicleTaxiLightOn
- setVehicleVariant
- setVehicleSirens