UNPKG

rock-mod

Version:

Rock-Mod is a powerful framework designed for creating and managing mods for Grand Theft Auto (GTA) games.

169 lines (168 loc) 5.26 kB
import { RageEntity } from "../entity/RageEntity"; import { RGBA } from "../../../../shared/index"; export class RageVehicle extends RageEntity { get bodyHealth() { return this.mpEntity.getBodyHealth(); } get engineHealth() { return this.mpEntity.getEngineHealth(); } get numberPlate() { return this.mpEntity.getNumberPlateText(); } get isDead() { return this.mpEntity.isDead(); } constructor(options) { super(options); } setBodyHealth(value) { this.mpEntity.setBodyHealth(value); } setEngineHealth(value) { this.mpEntity.setEngineHealth(value); } setNumberPlate(value) { this.mpEntity.setNumberPlateText(value); } explode() { return this.mpEntity.explode(true, true); } getPedInSeat(seat) { return this.mpEntity.getPedInSeat(seat); } get gear() { return this.mpEntity.gear; } get speed() { return this.mpEntity.getSpeed(); } get isEngineRunning() { return this.mpEntity.getIsEngineRunning(); } get lightsState() { return this.mpEntity.getLightsState(1, 1); } setUndriveable(toggle) { this.mpEntity.setUndriveable(toggle); } get maxNumberOfPassengers() { return this.mpEntity.getMaxNumberOfPassengers(); } setEngineOn(toggle, instantly, otherwise) { this.mpEntity.setEngineOn(toggle, instantly, otherwise); } get isLocked() { return this.mpEntity.locked; } setIsLocked(value) { this.mpEntity.locked = value; } setCustomPrimaryColour(color) { this.mpEntity.setCustomPrimaryColour(color.r, color.g, color.b); } setCustomSecondaryColour(color) { this.mpEntity.setCustomSecondaryColour(color.r, color.g, color.b); } get customPrimaryColour() { const color = this.mpEntity.getCustomPrimaryColour(0, 0, 0); return new RGBA(color.r, color.g, color.b); } get customSecondaryColour() { const color = this.mpEntity.getCustomSecondaryColour(0, 0, 0); return new RGBA(color.r, color.g, color.b); } setMod(modType, modIndex) { this.mpEntity.setMod(modType, modIndex); } getMod(modType) { return this.mpEntity.getMod(modType); } getNumMods(modType) { return this.mpEntity.getNumMods(modType); } setNeonLightEnabled(index, toggle) { this.mpEntity.setNeonLightEnabled(index, toggle); } setNeonLightsColour(color) { this.mpEntity.setNeonLightsColour(color.r, color.g, color.b); } setWindowTint(tintType) { this.mpEntity.setWindowTint(tintType); } get windowTint() { return this.mpEntity.getWindowTint(); } setWheelType(wheelType) { this.mpEntity.setWheelType(wheelType); } get wheelType() { return this.mpEntity.getWheelType(); } setNumberPlateType(index) { this.mpEntity.setNumberPlateTextIndex(index); } get numberPlateType() { return this.mpEntity.getNumberPlateTextIndex(); } setDoorOpen(doorIndex, loose, openInstantly) { this.mpEntity.setDoorOpen(doorIndex, loose, openInstantly); } setDoorShut(doorIndex, instantly) { this.mpEntity.setDoorShut(doorIndex, instantly); } setHandling(field, value) { this.mpEntity.setHandling(field, value); } getHandling(field) { return this.mpEntity.getHandling(field); } setEnginePowerMultiplier(value) { this.mpEntity.setEnginePowerMultiplier(value); } setEngineTorqueMultiplier(value) { this.mpEntity.setEngineTorqueMultiplier(value); } modifyTopSpeed(value) { mp.game.vehicle.modifyTopSpeed(this.handle, value); } setCheatPowerIncrease(value) { mp.game.vehicle.setCheatPowerIncrease(this.handle, value); } toggleMod(modType, toggle) { this.mpEntity.toggleMod(modType, toggle); } setTyreSmokeColor(r, g, b) { this.mpEntity.setTyreSmokeColor(r, g, b); } setModColor1(paintType, color, p3) { this.mpEntity.setModColor1(paintType, color, p3); } setExtraColours(pearlescentColor, wheelColor) { this.mpEntity.setExtraColours(pearlescentColor, wheelColor); } setHeadlightColor(colorIndex) { // _SET_VEHICLE_HEADLIGHT_COLOUR — no RAGEMP wrapper, invoke native by hash mp.game.invoke("0xE41033B25D003A07", this.handle, colorIndex); } setDashboardColor(colorIndex) { // SET_VEHICLE_DASHBOARD_COLOUR — no RAGEMP wrapper, invoke native by hash mp.game.invoke("0x6089CDF6A57F326C", this.handle, colorIndex); } setInteriorColor(colorIndex) { // SET_VEHICLE_INTERIOR_COLOUR — no RAGEMP wrapper, invoke native by hash mp.game.invoke("0xF40DD601A65F7F19", this.handle, colorIndex); } getMaxBraking() { return this.mpEntity.getMaxBraking(); } getAcceleration() { return this.mpEntity.getAcceleration(); } getMaxTraction() { return this.mpEntity.getMaxTraction(); } getModelMaxSpeed() { return mp.game.vehicle.getVehicleModelMaxSpeed(this.mpEntity.model); } }