import type { eVehicleSeat } from '../enums/eVehicleSeat'; import type { Ped } from '../classes/Ped'; import type { Player } from '../classes/Player'; import type { Prop } from '../classes/Prop'; import { Vector2 } from '../types/Vector2'; import { Vector3 } from '../types/Vector3'; import { Vector4 } from '../types/Vector4'; import { Color } from '../types/Color'; import { Entity } from './Entity'; import { registerHandle, createFromHandle } from '../types/HandleRegistry'; import { inv, rai, raf, ras, rav, pvi, pvf, pvv, pvii, pvfi, _h, f, int, uint, float, Hash, u8, u16, u32, u64, i8, i16, i32, i64 } from '../types/NativeAliases'; import { VehicleTask } from './VehicleTask'; export class Vehicle extends Entity { static fromHandle(handle: number): Vehicle | null { return handle === 0 ? null : new Vehicle(handle); } static fromNetworkId(netId: number): Vehicle | null { if (!inv('0x18A47D074708FD68', netId, rai())) return null; return Vehicle.fromHandle(inv('0xCE4E5D9B0A4FF560', netId, rai())); } /** * *SET_INSTANTLY** - _SET_MISSION_TRAIN* * * @param p1 */ N_0x6DE072AC8A95FFC1(p1: boolean): void { inv('0x6DE072AC8A95FFC1', this.handle, p1); } /** * 1000 is max health * Begins leaking gas at around 650 health * -999.90002441406 appears to be minimum health, although nothing special occurs <- false statement Minimum: -4000 * Maximum: 1000 -4000: Engine is destroyed * 0 and below: Engine catches fire and health rapidly declines * 300: Engine is smoking and losing functionality * 1000: Engine is perfect * * @param health */ set EngineHealth(health: float) { inv('0x8BDC5B998B4654EF', this.handle, f(health)); } /** * 1000 is max health * Begins leaking gas at around 650 health * -999.90002441406 appears to be minimum health, although nothing special occurs <- false statement Minimum: -4000 * Maximum: 1000 -4000: Engine is destroyed * 0 and below: Engine catches fire and health rapidly declines * 300: Engine is smoking and losing functionality * 1000: Engine is perfect * * @param health * @returns The instance for method chaining */ setEngineHealth(health: float): this { inv('0x8BDC5B998B4654EF', this.handle, f(health)); return this; } /** * Apply damage to vehicle at a location. Location is relative to vehicle model (not world). Radius of effect damage applied in a sphere at impact location * * @param offset * @param damage * @param radius * @param p6 * @returns The instance for method chaining */ setDamage(offset: Vector3, damage: float, radius: float, p6: boolean): this { inv('0x1D7678F81452BB41', this.handle, f(offset.x), f(offset.y), f(offset.z), f(damage), f(radius), p6); return this; } /** * @param p1 */ set BrokenPartsDontAffectAiHandling(p1: boolean) { inv('0xCEC4CA2CAB8FA98C', this.handle, p1); } /** * @param p1 * @returns The instance for method chaining */ setBrokenPartsDontAffectAiHandling(p1: boolean): this { inv('0xCEC4CA2CAB8FA98C', this.handle, p1); return this; } showHorseReins(): void { inv('0x41CDA90EE3450921', this.handle); } /** * @param toggle */ set DisablePetrolTankFires(toggle: boolean) { inv('0xB70986AB19B04AFF', this.handle, toggle); } /** * @param toggle * @returns The instance for method chaining */ setDisablePetrolTankFires(toggle: boolean): this { inv('0xB70986AB19B04AFF', this.handle, toggle); return this; } /** * whistleSequence: ACKNOWLEDGE, BACKING_UP, CROSSING, DANGER, MOVING, NEXT_STATION, PASSING, STOPPED * p2 = true seems to mute the sound * * @param whistleSequence * @param p2 * @param p3 */ triggerTrainWhistle(whistleSequence: string, p2: boolean, p3: boolean): void { inv('0xCFE122EC635CC2B2', this.handle, whistleSequence, p2, p3); } /** * @param toggle */ set DoorsLockedForAllPlayers(toggle: boolean) { inv('0x2381977DA948F8DC', this.handle, toggle); } /** * @param toggle * @returns The instance for method chaining */ setDoorsLockedForAllPlayers(toggle: boolean): this { inv('0x2381977DA948F8DC', this.handle, toggle); return this; } /** * @param p1 */ set MayBeUsedByGotoPointAnyMeans(p1: boolean) { inv('0x7549B9E841940695', this.handle, p1); } /** * @param p1 * @returns The instance for method chaining */ setMayBeUsedByGotoPointAnyMeans(p1: boolean): this { inv('0x7549B9E841940695', this.handle, p1); return this; } /** * Seems related to vehicle health, like the one in IV. * Max 1000, min 0. * Vehicle does not necessarily explode or become undrivable at 0. * * @returns */ get BodyHealth(): float { return inv('0x42113B857E33C16E', this.handle, raf()); } /** * @returns */ get IsTrainWaitingAtStation(): boolean { return !!inv('0xE887BD31D97793F6', this.handle, rai()); } /** * @returns */ get EstimatedMaxSpeed(): float { return inv('0xFE52F34491529F0B', this.handle, raf()); } /** * @param toggle */ set WheelsCanBreakOffWhenBlowUp(toggle: boolean) { inv('0xC462C79379ABBCB1', this.handle, toggle); } /** * @param toggle * @returns The instance for method chaining */ setWheelsCanBreakOffWhenBlowUp(toggle: boolean): this { inv('0xC462C79379ABBCB1', this.handle, toggle); return this; } /** * windowIndex: * 0 = Front Right Window * 1 = Front Left Window * 2 = Back Right Window * 3 = Back Left Window * * @param windowIndex */ removeWindow(windowIndex: int): void { inv('0x745F15A215F2DDF1', this.handle, windowIndex); } /** * Returns train car, use GET_TRAIN_CARRIAGE when trailerNumber is bigger than 0 * * @returns */ get TrainCar(): Entity | null { return createFromHandle('Entity', inv('0x671A07C9A1CD50A5', this.handle, rai())); } /** * @param enabled */ set WheelsCanBreak(enabled: boolean) { inv('0x839137C40275FB77', this.handle, enabled); } /** * @param enabled * @returns The instance for method chaining */ setWheelsCanBreak(enabled: boolean): this { inv('0x839137C40275FB77', this.handle, enabled); return this; } /** * Requires a visibility tracker on the vehicle (TRACK_VEHICLE_VISIBILITY) * * @returns */ get IsVisible(): boolean { return !!inv('0x424910CD5DE8C246', this.handle, rai()); } /** * @param toggle */ set BoatAnchor(toggle: boolean) { inv('0xAEAB044F05B92659', this.handle, toggle); } /** * @param toggle * @returns The instance for method chaining */ setBoatAnchor(toggle: boolean): this { inv('0xAEAB044F05B92659', this.handle, toggle); return this; } /** * @returns */ get Tint(): int { return inv('0xA44D65E6C624526F', this.handle, rai()); } /** * @param toggle */ set InactiveDuringPlayback(toggle: boolean) { inv('0x4EA71B4C9DB3C3F1', this.handle, toggle); } /** * @param toggle * @returns The instance for method chaining */ setInactiveDuringPlayback(toggle: boolean): this { inv('0x4EA71B4C9DB3C3F1', this.handle, toggle); return this; } /** * @param doorId * @param closeInstantly Refer to {@link eDoorId} * @returns The instance for method chaining */ setDoorShut(doorId: int, closeInstantly: boolean): this { inv('0x6A3C24B91FD0EA09', this.handle, doorId, closeInstantly); return this; } /** * Makes the vehicle accept no passengers. * * @param toggle */ set AllowNoPassengersLockon(toggle: boolean) { inv('0xECB9E9BC887E8060', this.handle, toggle); } /** * Makes the vehicle accept no passengers. * * @param toggle * @returns The instance for method chaining */ setAllowNoPassengersLockon(toggle: boolean): this { inv('0xECB9E9BC887E8060', this.handle, toggle); return this; } /** * @param index * @returns */ getBreakableLockObject(index: int): Prop | null { return createFromHandle('Prop', inv('0x58F2244C1286D09A', this.handle, index, rai())); } /** * @returns */ get IsOnFire(): boolean { return !!inv('0x0E3BF7ED4169EC43', this.handle, rai()); } /** * Used in Script Function MC_LOCAL_SETUP_VEH - enabling transitions * * @param p1 */ N_0xC325A6BAA62CF8A2(p1: boolean): void { inv('0xC325A6BAA62CF8A2', this.handle, p1); } /** * flags = 0: DEFAULT; 1: KEEP_OLD_SPEED * * @param flags */ set MissionTrainAsNoLongerNeeded(flags: int) { inv('0xBBE7648349B49BE8', this.handle, flags); } /** * flags = 0: DEFAULT; 1: KEEP_OLD_SPEED * * @param flags * @returns The instance for method chaining */ setMissionTrainAsNoLongerNeeded(flags: int): this { inv('0xBBE7648349B49BE8', this.handle, flags); return this; } /** * @param p1 * @param p2 * @returns */ isDriveable(p1: boolean, p2: boolean): boolean { return !!inv('0xB86D29B10F627379', this.handle, p1, p2, rai()); } /** * Returns handles of boat paddles entities. * * @returns left; right */ get RowingOars(): [Entity | null, Entity | null] { const result = inv<[number, number]>('0xA6E210FB4283B767', this.handle, pvi(), pvi()); return [createFromHandle('Entity', result[0]), createFromHandle('Entity', result[1])]; } /** * Starts or stops the engine on the specified vehicle. vehicle: The vehicle to start or stop the engine on. * value: true to turn the vehicle on; false to turn it off. * instantly: if true, the vehicle will be set to the state immediately; otherwise, the current driver will physically turn on or off the engine. * * @param value * @param instantly * @returns The instance for method chaining */ setEngineOn(value: boolean, instantly: boolean): this { inv('0xB64CFA14CB9A2E78', this.handle, value, instantly); return this; } /** * *SET_TRAIN** * * @param p1 */ N_0x06A09A6E0C6D2A84(p1: boolean): void { inv('0x06A09A6E0C6D2A84', this.handle, p1); } /** * Forcing high LOD buoyancy for vehicle: p1 = false * _SET_A* * * @param p1 */ N_0x9E8711C81AA17876(p1: boolean): void { inv('0x9E8711C81AA17876', this.handle, p1); } /** * @param speed */ set ForwardSpeed(speed: float) { inv('0xF9F92AF49F12F6E7', this.handle, f(speed)); } /** * @param speed * @returns The instance for method chaining */ setForwardSpeed(speed: float): this { inv('0xF9F92AF49F12F6E7', this.handle, f(speed)); return this; } /** * @returns */ get BreakableLocksState(): int { return inv('0xE015CF1F2C0959D8', this.handle, rai()); } /** * Locks the vehicle's steering to the desired angle, explained below. Requires to be called onTick. Steering is unlocked the moment the function stops being called on the vehicle. Steer bias: * -1.0 = full right * 0.0 = centered steering * 1.0 = full left * * @param value */ set SteerBias(value: float) { inv('0x84DAAE11E9EE4FC3', this.handle, f(value)); } /** * Locks the vehicle's steering to the desired angle, explained below. Requires to be called onTick. Steering is unlocked the moment the function stops being called on the vehicle. Steer bias: * -1.0 = full right * 0.0 = centered steering * 1.0 = full left * * @param value * @returns The instance for method chaining */ setSteerBias(value: float): this { inv('0x84DAAE11E9EE4FC3', this.handle, f(value)); return this; } hideHorseReins(): void { inv('0x201B8ED4FF7FE9F5', this.handle); } /** * @param p1 */ N_0x87B974E54C71BA7B(p1: boolean): void { inv('0x87B974E54C71BA7B', this.handle, p1); } /** * if true, axles won't bend. * * @param toggle */ set HasStrongAxles(toggle: boolean) { inv('0x252253C8A45AA1FC', this.handle, toggle); } /** * if true, axles won't bend. * * @param toggle * @returns The instance for method chaining */ setHasStrongAxles(toggle: boolean): this { inv('0x252253C8A45AA1FC', this.handle, toggle); return this; } /** * @returns */ get IsPlaybackGoingOnForVehicle(): boolean { return !!inv('0x02774B3A9034278F', this.handle, rai()); } /** * Gets the trailer of a vehicle and puts it into the trailer parameter. * * @returns trailer */ get TrailerVehicle(): [boolean, Vehicle | null] { const result = inv<[boolean, number]>('0xCF867A239EC30741', this.handle, pvi(), rai()); return [!!result[0], createFromHandle('Vehicle', result[1])]; } /** * https://github.com/femga/rdr3_discoveries/blob/master/vehicles/vehicle_modding/vehicle_liveries.lua * * @param liveryIndex */ set Livery(liveryIndex: int) { inv('0xF89D82A0582E46ED', this.handle, liveryIndex); } /** * https://github.com/femga/rdr3_discoveries/blob/master/vehicles/vehicle_modding/vehicle_liveries.lua * * @param liveryIndex * @returns The instance for method chaining */ setLivery(liveryIndex: int): this { inv('0xF89D82A0582E46ED', this.handle, liveryIndex); return this; } /** * @param toggle */ set ForceEngineDamageByBullet(toggle: boolean) { inv('0x7F8E2B131E1DCA6C', this.handle, toggle); } /** * @param toggle * @returns The instance for method chaining */ setForceEngineDamageByBullet(toggle: boolean): this { inv('0x7F8E2B131E1DCA6C', this.handle, toggle); return this; } /** * Params: destroyingForce is usually 100f in R* Scripts * Similar to 0xD4F5EFB55769D272, _A* * * @param wheelIndex * @param destroyingForce */ breakOffDraftWheel(wheelIndex: int, destroyingForce: float): void { inv('0xC372B6A88F6E4AD8', this.handle, wheelIndex, f(destroyingForce)); } /** * Restarts the train * * @returns The instance for method chaining */ setTrainLeaveStation(): this { inv('0x787E43477746876F', this.handle); return this; } /** * @param p1 */ set DisableEngineFires(p1: boolean) { inv('0xD146EE5F2B06B95E', this.handle, p1); } /** * @param p1 * @returns The instance for method chaining */ setDisableEngineFires(p1: boolean): this { inv('0xD146EE5F2B06B95E', this.handle, p1); return this; } /** * Returns 1000.0 if the function is unable to get the address of the specified vehicle or if it's not a vehicle. Minimum: -4000 * Maximum: 1000 -4000: Engine is destroyed * 0 and below: Engine catches fire and health rapidly declines * 300: Engine is smoking and losing functionality * 1000: Engine is perfect * * @returns */ get EngineHealth(): float { return inv('0x90DBFFAC43B22081', this.handle, raf()); } /** * @param speed */ set TrainSpeed(speed: float) { inv('0xDFBA6BBFF7CCAFBB', this.handle, f(speed)); } /** * @param speed * @returns The instance for method chaining */ setTrainSpeed(speed: float): this { inv('0xDFBA6BBFF7CCAFBB', this.handle, f(speed)); return this; } /** * wheelIndex 0: left, wheelIndex 1: right, 4 & 5: unknown * * @param wheelIndex * @returns */ breakOffWheel(wheelIndex: int): Entity | null { return createFromHandle('Entity', inv('0xD4F5EFB55769D272', this.handle, wheelIndex, rai())); } /** * Can also be used on trains and its wagons * * @param doorId * @param loose Refer to {@link eDoorId} * @param openInstantly * @returns The instance for method chaining */ setDoorOpen(doorId: int, loose: boolean, openInstantly: boolean): this { inv('0x550CE392A4672412', this.handle, doorId, loose, openInstantly); return this; } /** * @param toggle */ set AllowHomingMissleLockon(toggle: boolean) { inv('0x1240E8596A8308B9', this.handle, toggle); } /** * @param toggle * @returns The instance for method chaining */ setAllowHomingMissleLockon(toggle: boolean): this { inv('0x1240E8596A8308B9', this.handle, toggle); return this; } /** * @returns The instance for method chaining */ setTrainHalt(): this { inv('0x3660BCAB3A6BB734', this.handle); return this; } /** * @param player * @returns */ getDoorsLockedForPlayer(player: Player): boolean { return !!inv('0xFA2CDDFEB8BC898B', this.handle, player.handle, rai()); } /** * @param multiplier */ set LodMultiplier(multiplier: float) { inv('0x5F5E2B1B9EAECC0F', this.handle, f(multiplier)); } /** * @param multiplier * @returns The instance for method chaining */ setLodMultiplier(multiplier: float): this { inv('0x5F5E2B1B9EAECC0F', this.handle, f(multiplier)); return this; } /** * @param value */ set TrainWhistleEnabled(value: boolean) { inv('0x1BFBAFCC6760FF02', this.handle, value); } /** * @param value * @returns The instance for method chaining */ setTrainWhistleEnabled(value: boolean): this { inv('0x1BFBAFCC6760FF02', this.handle, value); return this; } /** * _SET_VEHICLE_S* * * @param p1 */ N_0x0794199B25E499E1(p1: boolean): void { inv('0x0794199B25E499E1', this.handle, p1); } /** * @param model * @returns */ isModel(model: string | number): boolean { return !!inv('0x0045A54EC7A22455', this.handle, _h(model), rai()); } /** * @returns seatIndex: Refer to {@link eVehicleSeat} */ get TurretSeat(): [any, number] { const result = inv<[number, number]>('0xFF5791B7639C2A46', this.handle, pvi()); return [result[0], result[1]]; } /** * Often called after START_PLAYBACK_RECORDED_VEHICLE and SKIP_TIME_IN_PLAYBACK_RECORDED_VEHICLE; similar in use to FORCE_ENTITY_AI_AND_ANIMATION_UPDATE. * * @param p1 */ forcePlaybackRecordedUpdate(p1: boolean): void { inv('0x59ECA796021B0539', this.handle, p1); } /** * @param p1 */ N_0x850CE59DEC2028F3(p1: any): void { inv('0x850CE59DEC2028F3', this.handle, p1); } /** * @param extraId * @returns */ isExtraTurnedOn(extraId: int): boolean { return !!inv('0xFA9A55D9C4351625', this.handle, extraId, rai()); } /** * @param amount * @param p2 * @param p3 * @returns The instance for method chaining */ setDeterioration(amount: float, p2: int, p3: boolean): this { inv('0x8E5DA070BAD3279E', this.handle, f(amount), p2, p3); return this; } /** * returns true if any wheel is destroyed/detached * * @returns */ areAnyWheelsDestroyed(): boolean { return !!inv('0x18714953CCED17D3', this.handle, rai()); } stopPlaybackRecordedVehicle(): void { inv('0xBF9B4D6267E8C26D', this.handle); } /** * @returns */ get IsDraftVehicle(): boolean { return !!inv('0xEA44E97849E9F3DD', this.handle, rai()); } /** * Hashes: COACH2_BOOT_LOOT_ITEMS_COACHROB_RSC, COACH2_BOOT_LOOT_ITEMS_COACHROB, COACH2_MARY3 * * @param coachrobberyLoot */ set ForceCoachRobberyLoot(coachrobberyLoot: string | number) { inv('0xF489F94BFEE12BB0', this.handle, _h(coachrobberyLoot)); } /** * Hashes: COACH2_BOOT_LOOT_ITEMS_COACHROB_RSC, COACH2_BOOT_LOOT_ITEMS_COACHROB, COACH2_MARY3 * * @param coachrobberyLoot * @returns The instance for method chaining */ setForceCoachRobberyLoot(coachrobberyLoot: string | number): this { inv('0xF489F94BFEE12BB0', this.handle, _h(coachrobberyLoot)); return this; } /** * @param doorId * @param doorLockStatus Refer to {@link eDoorId} * @returns The instance for method chaining */ setIndividualDoorsLocked(doorId: int, doorLockStatus: int): this { inv('0xA9F1D75195CC40F6', this.handle, doorId, doorLockStatus); return this; } /** * @param toggle */ set TrainStopsForStations(toggle: boolean) { inv('0x4182C037AA1F0091', this.handle, toggle); } /** * @param toggle * @returns The instance for method chaining */ setTrainStopsForStations(toggle: boolean): this { inv('0x4182C037AA1F0091', this.handle, toggle); return this; } /** * @param p1 */ N_0x160C1B5AB48AB87C(p1: float): void { inv('0x160C1B5AB48AB87C', this.handle, f(p1)); } /** * @returns */ get TimePositionInRecording(): float { return inv('0x233B51C7913FA031', this.handle, raf()); } /** * This native makes the vehicle stop immediately distance defines how far it will travel until stopping. * * @param distance * @param duration * @param unknown */ bringToHalt(distance: float, duration: int, unknown: boolean): void { inv('0x260BE8F09E326A20', this.handle, f(distance), duration, unknown); } /** * @returns */ get Owner(): Entity | null { return createFromHandle('Entity', inv('0xB729679356A889AE', this.handle, rai())); } /** * @param trackIndex * @param pos */ addTrainTemporaryStop(trackIndex: int, pos: Vector3): void { inv('0x41503629D1139ABC', this.handle, trackIndex, f(pos.x), f(pos.y), f(pos.z)); } /** * @param toggle */ set InfluencesWantedLevel(toggle: boolean) { inv('0xC1842F40FD501DA2', this.handle, toggle); } /** * @param toggle * @returns The instance for method chaining */ setInfluencesWantedLevel(toggle: boolean): this { inv('0xC1842F40FD501DA2', this.handle, toggle); return this; } /** * @param state */ set CanBeTargetted(state: boolean) { inv('0x05254BA0B44ADC16', this.handle, state); } /** * @param state * @returns The instance for method chaining */ setCanBeTargetted(state: boolean): this { inv('0x05254BA0B44ADC16', this.handle, state); return this; } /** * @returns */ get TrackIndexOfTrain(): int { return inv('0x865FEC2FA899F29C', this.handle, rai()); } /** * @param p1 */ N_0xC399CC89FBA05DA0(p1: boolean): void { inv('0xC399CC89FBA05DA0', this.handle, p1); } /** * 1000 is max health * * @returns */ get PetrolTankHealth(): float { return inv('0x1E5A9B356D5098BE', this.handle, raf()); } /** * @param doorId * @param p2 Refer to {@link eDoorId} * @param p3 * @param p4 * @returns The instance for method chaining */ setDoorLatched(doorId: int, p2: boolean, p3: boolean, p4: boolean): this { inv('0x06F8A202EB312A3C', this.handle, doorId, p2, p3, p4); return this; } /** * @returns */ get DriverOfVehicle(): Ped | null { return createFromHandle('Ped', inv('0x2963B5C1637E8A27', this.handle, rai())); } /** * @param seatIndex * @returns Returns the ped in the specified vehicle seat, or `0` if there wasn't a ped. */ getPedInSeat(seatIndex: eVehicleSeat): Ped | null { return createFromHandle('Ped', inv('0xBB40DD2270B65366', this.handle, seatIndex, rai())); } deleteMissionTrain(): void { inv('0x0D3630FB07E8B570', this.handle); } /** * @param p1 */ set NotStealableAmbiently(p1: boolean) { inv('0x09C970AE59ABF6B2', this.handle, p1); } /** * @param p1 * @returns The instance for method chaining */ setNotStealableAmbiently(p1: boolean): this { inv('0x09C970AE59ABF6B2', this.handle, p1); return this; } /** * Returns iNumCars - to be used with GET_TRAIN_CARRIAGE (trailerNumber) * _C* (O, P, Q, R) * * @returns */ get TrainCarriageTrailerNumber(): int { return inv('0x60B7D1DCC312697D', this.handle, rai()); } /** * Old name: _SET_BOAT_FROZEN_WHEN_ANCHORED * * @param p1 * @param p2 * @returns The instance for method chaining */ setBoatRemainsAnchoredWhilePlayerIsDriver(p1: boolean, p2: boolean): this { inv('0x286771F3059A37A7', this.handle, p1, p2); return this; } /** * Allows you to toggle bulletproof tires. * * @param toggle */ set TyresCanBurst(toggle: boolean) { inv('0xEBD0A4E935106FE5', this.handle, toggle); } /** * Allows you to toggle bulletproof tires. * * @param toggle * @returns The instance for method chaining */ setTyresCanBurst(toggle: boolean): this { inv('0xEBD0A4E935106FE5', this.handle, toggle); return this; } /** * @param seatIndex * @returns */ canShuffleSeat(seatIndex: eVehicleSeat): boolean { return !!inv('0xF8B2D32A2231FD24', this.handle, seatIndex, rai()); } /** * @param toggle */ set EngineCanDegrade(toggle: boolean) { inv('0x48E4C137A71C2688', this.handle, toggle); } /** * @param toggle * @returns The instance for method chaining */ setEngineCanDegrade(toggle: boolean): this { inv('0x48E4C137A71C2688', this.handle, toggle); return this; } /** * @param p1 */ N_0x104D9A7B1C0D0783(p1: float): void { inv('0x104D9A7B1C0D0783', this.handle, f(p1)); } /** * @param p1 * @returns */ setOnGroundProperly(p1: boolean): boolean { return !!inv('0x7263332501E07F52', this.handle, p1, rai()); } /** * @param state */ set CanBeVisiblyDamaged(state: boolean) { inv('0x4BF8131AE811541C', this.handle, state); } /** * @param state * @returns The instance for method chaining */ setCanBeVisiblyDamaged(state: boolean): this { inv('0x4BF8131AE811541C', this.handle, state); return this; } /** * Returns p0 for 0xBA958F68031DDBFC (trackIndex) * * @returns */ get CurrentTrackForTrain(): int { return inv('0xAF787E081AC4A8EE', this.handle, rai()); } /** * @returns expected; actual */ get DraftAnimalCount(): [any, number, number] { const result = inv<[number, number, number]>('0xA19447D83294E29F', this.handle, pvi(), pvi()); return [result[0], result[1], result[2]]; } /** * @param ped * @returns */ detachDraftHarnessPed(ped: Ped): any { return inv('0xB36D3EC70963BE60', this.handle, ped.handle); } /** * Spawn without lanterns set * * @returns */ deleteLanterns(): any { return inv('0xE1A83D4A3B5D7938', this.handle); } /** * Used in Script Function MC_LOCAL_SETUP_VEH - enabling transitions * * @param p1 */ N_0xCBF88256E44D5D39(p1: boolean): void { inv('0xCBF88256E44D5D39', this.handle, p1); } /** * @returns */ get IsBoatGrounded(): boolean { return !!inv('0x30D86B2B7622D0EB', this.handle, rai()); } /** * @param pos */ N_0xB42C87521D1BDD2F(pos: Vector3): void { inv('0xB42C87521D1BDD2F', this.handle, f(pos.x), f(pos.y), f(pos.z)); } /** * @returns */ get Livery(): int { return inv('0xBB765B8FD49A796C', this.handle, rai()); } /** * Setting this to false, makes the specified vehicle to where if you press Y your character doesn't even attempt the animation to enter the vehicle. Hence it's not considered aka ignored. * * @param toggle */ set IsConsideredByPlayer(toggle: boolean) { inv('0x54800D386C5825E5', this.handle, toggle); } /** * Setting this to false, makes the specified vehicle to where if you press Y your character doesn't even attempt the animation to enter the vehicle. Hence it's not considered aka ignored. * * @param toggle * @returns The instance for method chaining */ setIsConsideredByPlayer(toggle: boolean): this { inv('0x54800D386C5825E5', this.handle, toggle); return this; } /** * Only returns true if BRING_VEHICLE_TO_HALT is called on vehicle beforehand * * @returns */ get IsBroughtToHalt(): boolean { return !!inv('0x404527BC03DA0E6C', this.handle, rai()); } /** * Outputs track hash and junction index on given train vehicle handle. * *RESET_VEHICLE** (?) * * @returns trainTrack; junctionIndex * @example * ```lua * local trainTrack, junctionIndex = Citizen.InvokeNative(0x09034479E6E3E269, train, Citizen.PointerValueInt(), Citizen.PointerValueInt()) * ``` */ returnTrainInfoFromHandle(): [any, number, number] { const result = inv<[number, number, number]>('0x09034479E6E3E269', this.handle, pvi(), pvi()); return [result[0], result[1], result[2]]; } /** * If set to true, vehicle will not take crash damage, but is still susceptible to damage from bullets and explosives * * @param toggle */ set Strong(toggle: boolean) { inv('0xAB315515C9F8803D', this.handle, toggle); } /** * If set to true, vehicle will not take crash damage, but is still susceptible to damage from bullets and explosives * * @param toggle * @returns The instance for method chaining */ setStrong(toggle: boolean): this { inv('0xAB315515C9F8803D', this.handle, toggle); return this; } /** * enum eDraftHarness * { * DRAFT_HARNESS_LR, * DRAFT_HARNESS_RR, * DRAFT_HARNESS_LM, * DRAFT_HARNESS_RM, * DRAFT_HARNESS_LF, * DRAFT_HARNESS_RF, * DRAFT_HARNESS_COUNT * }; * * @param harnessId * @returns */ getPedInDraftHarness(harnessId: int): Ped | null { return createFromHandle('Ped', inv('0xA8BA0BAE0173457B', this.handle, harnessId, rai())); } /** * wetLevel: 0.0 - 1.0 * * @param wetLevel */ set WetLevel(wetLevel: float) { inv('0x5AABB09F6FBD1F87', this.handle, f(wetLevel)); } /** * wetLevel: 0.0 - 1.0 * * @param wetLevel * @returns The instance for method chaining */ setWetLevel(wetLevel: float): this { inv('0x5AABB09F6FBD1F87', this.handle, f(wetLevel)); return this; } /** * @param pos * @param p4 * @param p5 */ N_0x2200AB13CBD10F4E(pos: Vector3, p4: boolean, p5: float): void { inv('0x2200AB13CBD10F4E', this.handle, f(pos.x), f(pos.y), f(pos.z), p4, f(p5)); } /** * @param canBreak */ set DraftYokeCanBreak(canBreak: boolean) { inv('0x226C6A4E3346D288', this.handle, canBreak); } /** * @param canBreak * @returns The instance for method chaining */ setDraftYokeCanBreak(canBreak: boolean): this { inv('0x226C6A4E3346D288', this.handle, canBreak); return this; } /** * @param toggle */ set ForceHdVehicle(toggle: boolean) { inv('0x373CB1283308BD7B', this.handle, toggle); } /** * @param toggle * @returns The instance for method chaining */ setForceHdVehicle(toggle: boolean): this { inv('0x373CB1283308BD7B', this.handle, toggle); return this; } /** * Used to be incorrectly named SET_VEHICLE_EXCLUSIVE_DRIVER * * @param toggle */ set AiCanUseExclusiveSeats(toggle: boolean) { inv('0x0893DAFBFA67110E', this.handle, toggle); } /** * Used to be incorrectly named SET_VEHICLE_EXCLUSIVE_DRIVER * * @param toggle * @returns The instance for method chaining */ setAiCanUseExclusiveSeats(toggle: boolean): this { inv('0x0893DAFBFA67110E', this.handle, toggle); return this; } /** * @param p1 */ N_0xA72B1BF3857B94D7(p1: boolean): void { inv('0xA72B1BF3857B94D7', this.handle, p1); } /** * *SET_DRAFT_VEHICLE*(STOP?)* * * @param p1 */ N_0xC4A2C11FC0D41916(p1: boolean): void { inv('0xC4A2C11FC0D41916', this.handle, p1); } /** * Explodes a selected vehicle. Vehicle vehicle = Vehicle you want to explode. * BOOL isAudible = If explosion makes a sound. * BOOL isInvisible = If the explosion is invisible or not. First BOOL does not give any visual explosion, the vehicle just falls apart completely but slowly and starts to burn. * * @param isAudible * @param isInvisible * @param p3 * @param p4 */ explodeVehicle(isAudible: boolean, isInvisible: boolean, p3: any, p4: any): void { inv('0x75DCED9EEC5769D7', this.handle, isAudible, isInvisible, p3, p4); } /** * Params: 1.0f will make balloon hover * * @param p1 */ set BalloonHoverState(p1: float) { inv('0x7C9E45A4CED2E8DA', this.handle, f(p1)); } /** * Params: 1.0f will make balloon hover * * @param p1 * @returns The instance for method chaining */ setBalloonHoverState(p1: float): this { inv('0x7C9E45A4CED2E8DA', this.handle, f(p1)); return this; } /** * @returns */ get DoorLockStatus(): int { return inv('0xC867FD144F2469D3', this.handle, rai()); } requestHighDetailModel(): void { inv('0x84B81EF78BD22357', this.handle); } /** * @returns */ get IsInBurnout(): boolean { return !!inv('0x3F5029A8FC060C48', this.handle, rai()); } /** * @param toggle */ set CanBeUsedByFleeingPeds(toggle: boolean) { inv('0xE42952510F84AFDB', this.handle, toggle); } /** * @param toggle * @returns The instance for method chaining */ setCanBeUsedByFleeingPeds(toggle: boolean): this { inv('0xE42952510F84AFDB', this.handle, toggle); return this; } /** * @param p1 */ set AllowExplodesOnContact(p1: boolean) { inv('0x8D3230A0ED7DE39F', this.handle, p1); } /** * @param p1 * @returns The instance for method chaining */ setAllowExplodesOnContact(p1: boolean): this { inv('0x8D3230A0ED7DE39F', this.handle, p1); return this; } /** * @param speed */ set TrainCruiseSpeed(speed: float) { inv('0x01021EB2E96B793C', this.handle, f(speed)); } /** * @param speed * @returns The instance for method chaining */ setTrainCruiseSpeed(speed: float): this { inv('0x01021EB2E96B793C', this.handle, f(speed)); return this; } /** * @returns */ get IsWrecked(): boolean { return !!inv('0xDDBEA5506C848227', this.handle, rai()); } /** * @param team * @returns */ getDoorsLockedForTeam(team: int): any { return inv('0xDD1E1393D966D39A', this.handle, team); } /** * *SET_TRAIN** * * @param p1 */ N_0xEF28A614B4B264B8(p1: boolean): void { inv('0xEF28A614B4B264B8', this.handle, p1); } /** * snowLevel: 0.0 - 1.0 * * @param snowLevel */ set SnowLevel(snowLevel: float) { inv('0x6F73EFAB11651D7F', this.handle, f(snowLevel)); } /** * snowLevel: 0.0 - 1.0 * * @param snowLevel * @returns The instance for method chaining */ setSnowLevel(snowLevel: float): this { inv('0x6F73EFAB11651D7F', this.handle, f(snowLevel)); return this; } lockDoorsWhenNoLongerNeeded(): void { inv('0x1EF36558FBDE2DAA', this.handle); } /** * @param toggle */ set DoorsToOpenAtAnyDistance(toggle: boolean) { inv('0x362CEDD2A41E0747', this.handle, toggle); } /** * @param toggle * @returns The instance for method chaining */ setDoorsToOpenAtAnyDistance(toggle: boolean): this { inv('0x362CEDD2A41E0747', this.handle, toggle); return this; } /** * @returns */ get IsOnAllWheels(): boolean { return !!inv('0x0D5D119529654EE0', this.handle, rai()); } /** * Deletes a vehicle. * The vehicle must be a mission entity to delete, so call this before deleting: SET_ENTITY_AS_MISSION_ENTITY(vehicle, true, true); eg how to use: * SET_ENTITY_AS_MISSION_ENTITY(vehicle, true, true); * DELETE_VEHICLE(&vehicle); Deletes the specified vehicle, then sets the handle pointed to by the pointer to NULL. */ deleteVehicle(): void { inv('0xE20A909D8C4A70F8', this.handle); } /** * @returns */ get MaxNumberOfPassengers(): int { return inv('0xA9C55F1C15E62E06', this.handle, rai()); } /** * Closes all doors of a vehicle: * * @param closeInstantly */ set DoorsShut(closeInstantly: boolean) { inv('0xA4FFCD645B11F25A', this.handle, closeInstantly); } /** * Closes all doors of a vehicle: * * @param closeInstantly * @returns The instance for method chaining */ setDoorsShut(closeInstantly: boolean): this { inv('0xA4FFCD645B11F25A', this.handle, closeInstantly); return this; } /** * @param p1 */ set StopInstantlyWhenPlayerInactive(p1: boolean) { inv('0xC84E138448507567', this.handle, p1); } /** * @param p1 * @returns The instance for method chaining */ setStopInstantlyWhenPlayerInactive(p1: boolean): this { inv('0xC84E138448507567', this.handle, p1); return this; } /** * @param nullAttributes */ resetStuckTimer(nullAttributes: int): void { inv('0x23298B468F7D88B6', this.handle, nullAttributes); } /** * Returns p1 for 0xBA958F68031DDBFC (stationIndex) * _GET_N* (NEAREST_STATION_FOR_TRAIN?) * * @returns */ N_0x1180A2974D251B7B(): int { return inv('0x1180A2974D251B7B', this.handle, rai()); } /** * @param p1 */ set DontAllowPlayerToEnterIfLockedForPlayer(p1: boolean) { inv('0x63DC1F22C903B709', this.handle, p1); } /** * @param p1 * @returns The instance for method chaining */ setDontAllowPlayerToEnterIfLockedForPlayer(p1: boolean): this { inv('0x63DC1F22C903B709', this.handle, p1); return this; } /** * @param p1 */ set CanEjectPassengersIfLocked(p1: boolean) { inv('0x065D03A9D6B2C6B5', this.handle, p1); } /** * @param p1 * @returns The instance for method chaining */ setCanEjectPassengersIfLocked(p1: boolean): this { inv('0x065D03A9D6B2C6B5', this.handle, p1); return this; } /** * Gets the number of passengers, NOT including the driver. Use IS_VEHICLE_SEAT_FREE(Vehicle, -1) to also check for the driver * * @returns */ get NumberOfPassengers(): int { return inv('0x59F3F16577CD79B2', this.handle, rai()); } /** * @param speed */ set PlaybackSpeed(speed: float) { inv('0xD78084EED4CD94C6', this.handle, f(speed)); } /** * @param speed * @returns The instance for method chaining */ setPlaybackSpeed(speed: float): this { inv('0xD78084EED4CD94C6', this.handle, f(speed)); return this; } /** * @returns */ hasTrainLoaded(): any { return inv('0xBD3C4A2ED509205E', this.handle); } /** * @returns */ N_0xDE8C5B9F65017FA1(): any { return inv('0xDE8C5B9F65017FA1', this.handle); } /** * @param p1 */ set HasUnbreakableLights(p1: boolean) { inv('0xC903855E028A05F2', this.handle, p1); } /** * @param p1 * @returns The instance for method chaining */ setHasUnbreakableLights(p1: boolean): this { inv('0xC903855E028A05F2', this.handle, p1); return this; } /** * @param p1 */ N_0xD826690B5CF3BEFF(p1: any): void { inv('0xD826690B5CF3BEFF', this.handle, p1); } /** * _H* */ N_0x41F0B254DDF71473(): void { inv('0x41F0B254DDF71473', this.handle); } /** * Notice: BOOL p4 was wrongly named takePassengers (?) * Can be used to rotate the train by setting the BOOL direction * * @param pos * @param direction * @returns The instance for method chaining */ setMissionTrainWarpToCoords(pos: Vector3, direction: boolean): this { inv('0xC9EA26893C9E4024', this.handle, f(pos.x), f(pos.y), f(pos.z), direction); return this; } /** * @param toggle */ set StaysFrozenWhenCleanedUp(toggle: boolean) { inv('0x23A3AB86E0807721', this.handle, toggle); } /** * @param toggle * @returns The instance for method chaining */ setStaysFrozenWhenCleanedUp(toggle: boolean): this { inv('0x23A3AB86E0807721', this.handle, toggle); return this; } /** * *SET_VEHICLE** */ N_0x04F0579DBDD32F34(): void { inv('0x04F0579DBDD32F34', this.handle); } /** * SET_TIME_POSITION_IN_RECORDING can be emulated by: desired_time - GET_TIME_POSITION_IN_RECORDING(vehicle) * * @param time */ skipTimeInPlaybackRecordedVehicle(time: float): void { inv('0x5F5E6379C59EFC56', this.handle, f(time)); } /** * @param player * @param toggle * @returns The instance for method chaining */ setDoorsLockedForPlayer(player: Player, toggle: boolean): this { inv('0x359A8EA1FB8D6F0F', this.handle, player.handle, toggle); return this; } /** * Returns false if every seat is occupied. * * @returns */ areAnySeatsFree(): boolean { return !!inv('0xA0A424505A1B6429', this.handle, rai()); } /** * @param speed */ set DraftDesiredSpeed(speed: float) { inv('0x0C3F0F7F92CA847C', this.handle, f(speed)); } /** * @param speed * @returns The instance for method chaining */ setDraftDesiredSpeed(speed: float): this { inv('0x0C3F0F7F92CA847C', this.handle, f(speed)); return this; } /** * @param toggle */ set BoatSinksWhenWrecked(toggle: boolean) { inv('0x62A6D317A011EA1D', this.handle, toggle); } /** * @param toggle * @returns The instance for method chaining */ setBoatSinksWhenWrecked(toggle: boolean): this { inv('0x62A6D317A011EA1D', this.handle, toggle); return this; } /** * @param seatIndex * @returns */ isSeatWarpOnly(seatIndex: eVehicleSeat): boolean { return !!inv('0x7892685BF6D9775E', this.handle, seatIndex, rai()); } /** * Sounds the horn for the specified vehicle. vehicle: The vehicle to activate the horn for. * mode: The hash of "NORMAL" or "HELDDOWN". Can be 0. * duration: The duration to sound the horn, in milliseconds. Note: If a player is in the vehicle, it will only sound briefly. * * @param duration * @param mode * @param forever */ startHorn(duration: int, mode: string | number, forever: boolean): void { inv('0xB4E3BFC39CA16057', this.handle, duration, _h(mode), forever); } /** * @returns */ get NumBreakableLockObjects(): int { return inv('0x2FA86833E3617E2D', this.handle, rai()); } /** * @param p1 */ N_0xE6BD7DD3FD474415(p1: boolean): void { inv('0xE6BD7DD3FD474415', this.handle, p1); } /** * Ranges from -1 to 2? (internal type is int8) * https://imgur.com/a/bPzHcft * * @param lodLevel */ set LodLevel(lodLevel: int) { inv('0x3FA7D7D1E0EA809E', this.handle, lodLevel); } /** * Ranges from -1 to 2? (internal type is int8) * https://imgur.com/a/bPzHcft * * @param lodLevel * @returns The instance for method chaining */ setLodLevel(lodLevel: int): this { inv('0x3FA7D7D1E0EA809E', this.handle, lodLevel); return this; } /** * Returns p1 for 0xBA958F68031DDBFC (stationIndex) * * @returns */ get CurrentStationForTrain(): int { return inv('0x86FA6D8B48667D75', this.handle, rai()); } /** * Params: coords = GET_ENTITY_VELOCITY * _SET_VELOCITY* * * @param pos */ N_0x12F6C6ED3EFF42DE(pos: Vector3): void { inv('0x12F6C6ED3EFF42DE', this.handle, f(pos.x), f(pos.y), f(pos.z)); } /** * Only used in R* SP Script rcm_abigail31: p1 = 5 * _GET_VEHICLE_T* - _GET_VO* * * @param p1 * @returns */ N_0xE1C0F8781BF130C2(p1: int): boolean { return !!inv('0xE1C0F8781BF130C2', this.handle, p1, rai()); } /** * @param offset */ set TrainOffsetFromStation(offset: float) { inv('0x8EC47DD4300BF063', this.handle, f(offset)); } /** * @param offset * @returns The instance for method chaining */ setTrainOffsetFromStation(offset: float): this { inv('0x8EC47DD4300BF063', this.handle, f(offset)); return this; } trackVisibility(): void { inv('0x1F3969B140DEE157', this.handle); } /** * @param p1 * @param p2 * @returns */ setAutomaticallyAttaches(p1: boolean, p2: any): any { return inv('0x501354951CD942DE', this.handle, p1, p2); } /** * @param toggle */ set Undriveable(toggle: boolean) { inv('0x6E884BAB713A2A94', this.handle, toggle); } /** * @param toggle * @returns The instance for method chaining */ setUndriveable(toggle: boolean): this { inv('0x6E884BAB713A2A94', this.handle, toggle); return this; } /** * Old name: _STOP_BRING_VEHICLE_TO_HALT */ stopBringingToHalt(): void { inv('0x7C06330BFDDA182E', this.handle); } /** * @param p1 */ N_0xCF342503CA4C8DF1(p1: float): void { inv('0xCF342503CA4C8DF1', this.handle, f(p1)); } /** * @param canDetach */ set DraftAnimalsCanDetach(canDetach: boolean) { inv('0x6090A031C69F384E', this.handle, canDetach); } /** * @param canDetach * @returns The instance for method chaining */ setDraftAnimalsCanDetach(canDetach: boolean): this { inv('0x6090A031C69F384E', this.handle, canDetach); return this; } /** * @returns */ get IsPlaybackUsingAiGoingOnForVehicle(): boolean { return !!inv('0x5A7472606EC5B7C1', this.handle, rai()); } /** * Sets a vehicle to be strongly resistant to explosions. p0 is the vehicle; set p1 to false to toggle the effect on/off. * * @param toggle */ set ExplodesOnHighExplosionDamage(toggle: boolean) { inv('0xA402939C6761E1A3', this.handle, toggle); } /** * Sets a vehicle to be strongly resistant to explosions. p0 is the vehicle; set p1 to false to toggle the effect on/off. * * @param toggle * @returns The instance for method chaining */ setExplodesOnHighExplosionDamage(toggle: boolean): this { inv('0xA402939C6761E1A3', this.handle, toggle); return this; } /** * Sets boat to be anchored on spawn, called together with SET_BOAT_ANCHOR and _SET_BOAT_ANCHOR_BUOYANCY_COEFFICIENT * * @param p1 */ set ForceLowLodAnchorMode(p1: boolean) { inv('0x75B49ACD73617437', this.handle, p1); } /** * Sets boat to be anchored on spawn, called together with SET_BOAT_ANCHOR and _SET_BOAT_ANCHOR_BUOYANCY_COEFFICIENT * * @param p1 * @returns The instance for method chaining */ setForceLowLodAnchorMode(p1: boolean): this { inv('0x75B49ACD73617437', this.handle, p1); return this; } /** * @param p1 */ N_0x1A861F899EBBE17C(p1: boolean): void { inv('0x1A861F899EBBE17C', this.handle, p1); } /** * Value: mostly 99999.9f Old name: _SET_BOAT_MOVEMENT_RESISTANCE * * @param value */ set BoatLowLodAnchorDistance(value: float) { inv('0xE3261532550D6A9F', this.handle, f(value)); } /** * Value: mostly 99999.9f Old name: _SET_BOAT_MOVEMENT_RESISTANCE * * @param value * @returns The instance for method chaining */ setBoatLowLodAnchorDistance(value: float): this { inv('0xE3261532550D6A9F', this.handle, f(value)); return this; } /** * @param pos */ set MissionTrainCoords(pos: Vector3) { inv('0x7632755962AB9922', this.handle, f(pos.x), f(pos.y), f(pos.z)); } /** * @param pos * @returns The instance for method chaining */ setMissionTrainCoords(pos: Vector3): this { inv('0x7632755962AB9922', this.handle, f(pos.x), f(pos.y), f(pos.z)); return this; } /** * Params: p1 usually true in R* Scripts * *SET_DRAFT_VEHICLE** * * @param p1 */ N_0x4C60C333F9CCA2B6(p1: boolean): void { inv('0x4C60C333F9CCA2B6', this.handle, p1); } /** * @param windowIndex * @returns */ isWindowIntact(windowIndex: int): boolean { return !!inv('0x0E7910A63E05B12C', this.handle, windowIndex, rai()); } /** * Copies sourceVehicle's damage (broken bumpers, broken lights, etc.) to targetVehicle. * * @param targetVehicle */ copyDamages(targetVehicle: Vehicle): void { inv('0xDBC28A8C683CD80B', this.handle, targetVehicle.handle); } /** * _SET_VEHICLE_LI* * * @param p1 */ set LimitSpeedWhenPlayerInactive(p1: boolean) { inv('0x8F75941C86EEBFCA', this.handle, p1); } /** * _SET_VEHICLE_LI* * * @param p1 * @returns The instance for method chaining */ setLimitSpeedWhenPlayerInactive(p1: boolean): this { inv('0x8F75941C86EEBFCA', this.handle, p1); return this; } /** * @param allow */ set DraftAllowDraftAnimalAutoCreation(allow: boolean) { inv('0x87344305778E5415', this.handle, allow); } /** * @param allow * @returns The instance for method chaining */ setDraftAllowDraftAnimalAutoCreation(allow: boolean): this { inv('0x87344305778E5415', this.handle, allow); return this; } /** * @param team * @param toggle * @returns The instance for method chaining */ setDoorsLockedForTeam(team: int, toggle: boolean): this { inv('0xE712BC978770F105', this.handle, team, toggle); return this; } /** * @param p1 */ N_0x7840576C50A13DBA(p1: boolean): void { inv('0x7840576C50A13DBA', this.handle, p1); } /** * @param toggle */ set CanBreak(toggle: boolean) { inv('0xC5ED9D59B4646611', this.handle, toggle); } /** * @param toggle * @returns The instance for method chaining */ setCanBreak(toggle: boolean): this { inv('0xC5ED9D59B4646611', this.handle, toggle); return this; } /** * @param toggle */ set Handbrake(toggle: boolean) { inv('0x91BE51AEC4E99710', this.handle, toggle); } /** * @param toggle * @returns The instance for method chaining */ setHandbrake(toggle: boolean): this { inv('0x91BE51AEC4E99710', this.handle, toggle); return this; } /** * Total height is calculated using: cargo ratio + pelt ratio (by pelt count) * Screenshot: https://imgur.com/a/nsomtiv * * @param height * @param immediately * @returns The instance for method chaining */ setBatchTarpHeight(height: float, immediately: boolean): this { inv('0x31F343383F19C987', this.handle, f(height), immediately); return this; } /** * @param dirtLevel */ set DirtLevel(dirtLevel: float) { inv('0x758C3460EE915D0A', this.handle, f(dirtLevel)); } /** * @param dirtLevel * @returns The instance for method chaining */ setDirtLevel(dirtLevel: float): this { inv('0x758C3460EE915D0A', this.handle, f(dirtLevel)); return this; } /** * VEH_STUCK_ON_ROOF = 0, * VEH_STUCK_ON_SIDE, * VEH_STUCK_HUNG_UP, * VEH_STUCK_JAMMED * * @param stuckType * @param ms * @returns */ isStuckTimerUp(stuckType: int, ms: int): boolean { return !!inv('0x1ABA9753939503C5', this.handle, stuckType, ms, rai()); } /** * Returns true if the vehicle's current speed is less than, or equal to 0.0025f. For some vehicles it returns true if the current speed is <= 0.00039999999. * * @returns */ get IsStopped(): boolean { return !!inv('0x78C3311A73135241', this.handle, rai()); } /** * @param p1 */ N_0x15CC8C33D7FFCC4A(p1: int): void { inv('0x15CC8C33D7FFCC4A', this.handle, p1); } /** * @param enabled */ set IsInHurry(enabled: boolean) { inv('0xCE1531927AD6C9F8', this.handle, enabled); } /** * @param enabled * @returns The instance for method chaining */ setIsInHurry(enabled: boolean): this { inv('0xCE1531927AD6C9F8', this.handle, enabled); return this; } /** * @param extraId * @returns */ doesExtraExist(extraId: int): boolean { return !!inv('0xAF5E7E9A7620FFB5', this.handle, extraId, rai()); } /** * @param seed */ set DraftAnimalRandomSeed(seed: int) { inv('0x8C6D9A399126C194', this.handle, seed); } /** * @param seed * @returns The instance for method chaining */ setDraftAnimalRandomSeed(seed: int): this { inv('0x8C6D9A399126C194', this.handle, seed); return this; } /** * @param wheel * @returns */ isWheelDestroyed(wheel: int): boolean { return !!inv('0xCB2CA620C48BC875', this.handle, wheel, rai()); } /** * p3 is some flag related to 'trailers' (invokes CVehicle::GetTrailer). See REQUEST_VEHICLE_RECORDING * * @param recording * @param script * @param p3 */ startPlaybackRecordedVehicle(recording: int, script: string, p3: boolean): void { inv('0x4932B84E3276508E', this.handle, recording, script, p3); } /** * dirtLevel: 0.0 - 1.0 * * @param dirtLevel */ set DirtLevel2(dirtLevel: float) { inv('0xBAE0EEDF93F05EAA', this.handle, f(dirtLevel)); } /** * dirtLevel: 0.0 - 1.0 * * @param dirtLevel * @returns The instance for method chaining */ setDirtLevel2(dirtLevel: float): this { inv('0xBAE0EEDF93F05EAA', this.handle, f(dirtLevel)); return this; } /** * @param trailerNumber * @returns */ getTrainCarriage(trailerNumber: int): Entity | null { return createFromHandle('Entity', inv('0xD0FB093A4CDB932C', this.handle, trailerNumber, rai())); } /** * @returns */ get IsFadingOut(): boolean { return !!inv('0x5136B284B67B35C7', this.handle, rai()); } fadeAndDestroyVehicle(): void { inv('0x35DC1877312FBA0F', this.handle); } /** * @returns */ get IsPropSetApplied(): any { return inv('0xD798DF5DB67B1659', this.handle); } /** * Maximum possible speed is 30.0 (108 km/h) * * @param speed */ set TrainMaxSpeed(speed: float) { inv('0x9F29999DFDF2AEB8', this.handle, f(speed)); } /** * Maximum possible speed is 30.0 (108 km/h) * * @param speed * @returns The instance for method chaining */ setTrainMaxSpeed(speed: float): this { inv('0x9F29999DFDF2AEB8', this.handle, f(speed)); return this; } /** * Old name: _SET_DISABLE_SUPERDUMMY_MODE * * @param disable */ set DisableSuperdummy(disable: boolean) { inv('0x1716D787D9B94202', this.handle, disable); } /** * Old name: _SET_DISABLE_SUPERDUMMY_MODE * * @param disable * @returns The instance for method chaining */ setDisableSuperdummy(disable: boolean): this { inv('0x1716D787D9B94202', this.handle, disable); return this; } /** * Old name: _SET_VEHICLE_DOOR_CAN_BREAK * * @param doorId * @param isBreakable Refer to {@link eDoorId} * @returns The instance for method chaining */ setDoorAllowedToBeBrokenOff(doorId: int, isBreakable: boolean): this { inv('0x081FB9D6422F804C', this.handle, doorId, isBreakable); return this; } /** * @param value */ set BodyHealth(value: float) { inv('0x55CCAAE4F28C67A0', this.handle, f(value)); } /** * @param value * @returns The instance for method chaining */ setBodyHealth(value: float): this { inv('0x55CCAAE4F28C67A0', this.handle, f(value)); return this; } /** * @param toggle */ set ProvidesCover(toggle: boolean) { inv('0x652712478F1721F4', this.handle, toggle); } /** * @param toggle * @returns The instance for method chaining */ setProvidesCover(toggle: boolean): this { inv('0x652712478F1721F4', this.handle, toggle); return this; } /** * @param value */ modifyTopSpeed(value: float): void { inv('0x35AD938C74CACD6A', this.handle, f(value)); } /** * index: 0 - 1 Used to be incorrectly named _SET_VEHICLE_EXCLUSIVE_DRIVER_2 * * @param ped * @param index * @returns The instance for method chaining */ setExclusiveDriver(ped: Ped, index: int): this { inv('0xC6B9BF123B9463B6', this.handle, ped.handle, index); return this; } /** * 1000 is max health * * @param health */ set PetrolTankHealth(health: float) { inv('0x6AB2918EE3BEC94C', this.handle, f(health)); } /** * 1000 is max health * * @param health * @returns The instance for method chaining */ setPetrolTankHealth(health: float): this { inv('0x6AB2918EE3BEC94C', this.handle, f(health)); return this; } /** * @param doorLockStatus */ set DoorsLocked(doorLockStatus: int) { inv('0x96F78A6A075D55D9', this.handle, doorLockStatus); } /** * @param doorLockStatus * @returns The instance for method chaining */ setDoorsLocked(doorLockStatus: int): this { inv('0x96F78A6A075D55D9', this.handle, doorLockStatus); return this; } /** * @returns */ canAnchorBoatHere(): boolean { return !!inv('0xC075176CFB8B4128', this.handle, rai()); } /** * This fixes a vehicle. * If the vehicle's engine's broken then you cannot fix it with this native. * * @returns The instance for method chaining */ setFixed(): this { inv('0x79811282A9D1AE56', this.handle); return this; } /** * @param toggle */ set KeepEngineOnWhenAbandoned(toggle: boolean) { inv('0x1549BA7FE83A2383', this.handle, toggle); } /** * @param toggle * @returns The instance for method chaining */ setKeepEngineOnWhenAbandoned(toggle: boolean): this { inv('0x1549BA7FE83A2383', this.handle, toggle); return this; } /** * @param harnessId * @returns */ detachDraftHarnessFromIndex(harnessId: int): any { return inv('0x4402960666000E62', this.handle, harnessId); } /** * Sets the vehicle's lights state. * * @param state */ set Lights(state: int) { inv('0x629F0A0E952CAE7D', this.handle, state); } /** * Sets the vehicle's lights state. * * @param state * @returns The instance for method chaining */ setLights(state: int): this { inv('0x629F0A0E952CAE7D', this.handle, state); return this; } /** * @param owned */ set HasBeenOwnedByPlayer(owned: boolean) { inv('0xBB5A3FA8ED3979C5', this.handle, owned); } /** * @param owned * @returns The instance for method chaining */ setHasBeenOwnedByPlayer(owned: boolean): this { inv('0xBB5A3FA8ED3979C5', this.handle, owned); return this; } /** * Note: only some vehicle have extras * https://github.com/femga/rdr3_discoveries/blob/master/vehicles/vehicle_modding/vehicle_extras.lua * * @param extraId * @param disable * @returns The instance for method chaining */ setExtra(extraId: int, disable: boolean): this { inv('0xBB6F89150BC9D16B', this.handle, extraId, disable); return this; } /** * @returns */ get TrainDirection(): any { return inv('0x3C9628A811CBD724', this.handle); } /** * @param seatIndex * @returns Returns the last ped in the `seatIndex` or `0` if there wasn't one, or the ped no longer exists. */ getLastPedInSeat(seatIndex: eVehicleSeat): Ped | null { return createFromHandle('Ped', inv('0x74583B19FEEAFDA7', this.handle, seatIndex, rai())); } /** * @param doorId * @param speed Refer to {@link eDoorId} * @param angle * @returns The instance for method chaining */ setDoorControl(doorId: int, speed: int, angle: float): this { inv('0xD57F10EBBA814ECF', this.handle, doorId, speed, f(angle)); return this; } /** * @param toggle */ set DisablePetrolTankDamage(toggle: boolean) { inv('0x5795FBE7A2001C14', this.handle, toggle); } /** * @param toggle * @returns The instance for method chaining */ setDisablePetrolTankDamage(toggle: boolean): this { inv('0x5795FBE7A2001C14', this.handle, toggle); return this; } /** * @param toggle */ set BreakableLocksUnbreakable(toggle: boolean) { inv('0xBC4735F48CD983EF', this.handle, toggle); } /** * @param toggle * @returns The instance for method chaining */ setBreakableLocksUnbreakable(toggle: boolean): this { inv('0xBC4735F48CD983EF', this.handle, toggle); return this; } /** * @param p1 */ set RespectsLocksWhenHasDriver(p1: boolean) { inv('0x33992A808DF1C1BA', this.handle, p1); } /** * @param p1 * @returns The instance for method chaining */ setRespectsLocksWhenHasDriver(p1: boolean): this { inv('0x33992A808DF1C1BA', this.handle, p1); return this; } /** * *SET_TRAIN** * * @param p1 */ N_0xAE7E66A61E7C17A5(p1: boolean): void { inv('0xAE7E66A61E7C17A5', this.handle, p1); } /** * Returns rage::NumericLimits::kMax (3.402823466e+38) if vehicle is not a valid vehicle of type VEHICLE_TYPE_DRAFT. * * @returns */ get DraftDesiredSpeed(): float { return inv('0xC6D7DDC843176701', this.handle, raf()); } /** * *SET_VEHICLE_WHEELS** * * @param p1 * @param p2 */ N_0x73118A3EE9C9B6DB(p1: int, p2: boolean): void { inv('0x73118A3EE9C9B6DB', this.handle, p1, p2); } /** * @param doorId * @returns */ isDoorBroken(doorId: int): boolean { return !!inv('0xE979BB5602AD3402', this.handle, doorId, rai()); } /** * @param doorId * @returns */ isDoorFullyOpen(doorId: int): boolean { return !!inv('0x7AE191143C7A9107', this.handle, doorId, rai()); } /** * @param p1 */ set ForceHighLodVehicle(p1: boolean) { inv('0x1098CDA477890165', this.handle, p1); } /** * @param p1 * @returns The instance for method chaining */ setForceHighLodVehicle(p1: boolean): this { inv('0x1098CDA477890165', this.handle, p1); return this; } /** * Use - 1 for last seat index. * * @param seatIndex * @returns Returns `true` if the vehicle seat is free (has no ped in it) */ isSeatFree(seatIndex: eVehicleSeat): boolean { return !!inv('0xE052C1B1CAA4ECE4', this.handle, seatIndex, rai()); } /** * https://github.com/femga/rdr3_discoveries/blob/master/vehicles/vehicle_modding/vehicle_tints.lua * * @param tintId */ set Tint(tintId: int) { inv('0x8268B098F6FCA4E2', this.handle, tintId); } /** * https://github.com/femga/rdr3_discoveries/blob/master/vehicles/vehicle_modding/vehicle_tints.lua * * @param tintId * @returns The instance for method chaining */ setTint(tintId: int): this { inv('0x8268B098F6FCA4E2', this.handle, tintId); return this; } /** * Returns trackIndex * * @returns */ get TrainTrackFromTrainVehicle(): int { return inv('0x45853F4E17D847D5', this.handle, rai()); } /** * mudLevel: 0.0 - 1.0 * * @param mudLevel */ set MudLevel(mudLevel: float) { inv('0x4D15E49764CB328A', this.handle, f(mudLevel)); } /** * mudLevel: 0.0 - 1.0 * * @param mudLevel * @returns The instance for method chaining */ setMudLevel(mudLevel: float): this { inv('0x4D15E49764CB328A', this.handle, f(mudLevel)); return this; } /** * *SET_DRAFT_VEHICLE** * * @param p1 */ N_0xFC4F15A7DDDC47B1(p1: boolean): void { inv('0xFC4F15A7DDDC47B1', this.handle, p1); } /** * @param toggle */ N_0x6B53F4B811E583D2(toggle: boolean): void { inv('0x6B53F4B811E583D2', this.handle, toggle); } /** * @param isStolen */ set IsStolen(isStolen: boolean) { inv('0x6C32FC81DFF25C9A', this.handle, isStolen); } /** * @param isStolen * @returns The instance for method chaining */ setIsStolen(isStolen: boolean): this { inv('0x6C32FC81DFF25C9A', this.handle, isStolen); return this; } /** * @param doorId * @param deleteDoor Refer to {@link eDoorId} * @returns The instance for method chaining */ setDoorBroken(doorId: int, deleteDoor: boolean): this { inv('0x9666CF20A1C6D780', this.handle, doorId, deleteDoor); return this; } private _task?: VehicleTask; get task(): VehicleTask { if (!this._task) { this._task = new VehicleTask(this); } return this._task; } } registerHandle('Vehicle', Vehicle);