UNPKG

rock-mod

Version:

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

69 lines (68 loc) 3.13 kB
import { RageEntity } from "../entity/RageEntity"; import { Vector3D } from "../../../../shared/common/utils"; export class RagePed extends RageEntity { constructor(options) { super(options); } setDecoration(collection, overlay) { const collectionHash = mp.game.joaat(collection); const overlayHash = mp.game.joaat(overlay); this.mpEntity.setDecoration(collectionHash, overlayHash); } removeDecoration(collection, overlay) { const collectionHash = mp.game.joaat(collection); const overlayHash = mp.game.joaat(overlay); // @ts-expect-error TODO test if this works this.mpEntity.removeDecoration(collectionHash, overlayHash); } clearDecorations() { this.mpEntity.clearDecorations(); } setHeadBlendData(shapeFirstId, shapeSecondId, shapeThirdId, skinFirstId, skinSecondId, skinThirdId, shapeMix, skinMix, thirdMix, isParent) { this.mpEntity.setHeadBlendData(shapeFirstId, shapeSecondId, shapeThirdId, skinFirstId, skinSecondId, skinThirdId, shapeMix, skinMix, thirdMix, isParent); } setFaceFeature(index, value) { this.mpEntity.setFaceFeature(index, value); } setHeadOverlay(overlayId, index, opacity) { this.mpEntity.setHeadOverlay(overlayId, index, opacity); } setHeadOverlayColor(overlayId, colorTypeId, firstColor, secondColor) { this.mpEntity.setHeadOverlayColor(overlayId, colorTypeId, firstColor, secondColor); } setEyeColor(eyeColor) { this.mpEntity.setEyeColor(eyeColor); } setHairColor(colorId, highlightColorId) { this.mpEntity.setHairColor(colorId, highlightColorId); } setComponentVariation(componentId, drawableId, textureId, paletteId) { this.mpEntity.setComponentVariation(componentId, drawableId, textureId, paletteId); } setPropertyVariation(componentId, drawableId, textureId, attach) { this.mpEntity.setPropIndex(componentId, drawableId, textureId, attach); } clearProp(componentId) { this.mpEntity.clearProp(componentId); } getBoneCoords(boneId, offsetX, offsetY, offsetZ) { const { x, y, z } = this.mpEntity.getBoneCoords(boneId, offsetX, offsetY, offsetZ); return new Vector3D(x, y, z); } clearTasks() { this.mpEntity.clearTasks(); } taskPlayAnim(dictionary, name, blendInSpeed, blendOutSpeed, duration, flag, playbackRate) { this.mpEntity.taskPlayAnim(dictionary, name, blendInSpeed, blendOutSpeed, duration, flag, playbackRate, false, false, false); } stopAnim(dictionary, name, blendOutSpeed) { mp.game.task.stopAnimTask(this.handle, dictionary, name, blendOutSpeed); } taskGoToCoordAnyMeans(x, y, z, speed, walkingStyle = 786603, drivingFlags = 0xbf800000) { mp.game.task.goToCoordAnyMeans(this.handle, x, y, z, speed, 0, false, walkingStyle, drivingFlags); } setBlockingOfNonTemporaryEvents(blocking) { // BLOCKING_OF_NON_TEMPORARY_EVENTS — no RAGEMP wrapper, invoke native by hash mp.game.invoke("0x9F8AA94D6D97DBF4", this.handle, blocking); } }