RU/getVehicleName
Jump to navigation
Jump to search
Эта функция возвращает строку, содержащую название транспорта.
Синтаксис
string getVehicleName ( vehicle theVehicle )
Обязательные аргументы
- theVehicle: Транспорт, название которого вы хотите получить.
Возвращает
Возвращает строку, содержащую название транспорта, или false, если транспорт, переданный в функцию, недействителен.
Пример
Данный пример проверяет сел ли игрок в AT-400 или Shamal. Если так, то сообщаем в чат какой именно самолёт был украден.
function planeEnter ( theVehicle, seat, jacked ) -- при входе кого-либо в транспорт local id = getElementModel ( theVehicle ) -- получаем ID модели транспорта if id == 519 or id == 577 then -- если theVehicle Shamal или AT-400 local vehicleName = getVehicleName ( theVehicle ) -- получаем название theVehicle outputChatBox ( "Кто-то украл " .. vehicleName .. "!" ) -- сообщаем, что кто-то украл самолёт end end -- добавляем обработчик события addEventHandler ( "onPlayerVehicleEnter", getRootElement(), planeEnter )
Смотрите также
- 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