import type { Entity } from '../classes/Entity'; import type { Ped } from '../classes/Ped'; import { Vector2 } from '../types/Vector2'; import { Vector3 } from '../types/Vector3'; import { Vector4 } from '../types/Vector4'; import { Color } from '../types/Color'; import { IHandle } from '../types/IHandle'; 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'; export class PersChar implements IHandle { constructor(public handle: number) {} static fromHandle(handle: number): PersChar | null { return handle === 0 ? null : new PersChar(handle); } /** * @returns */ revivePerschar(): any { return inv('0x49A8C2CD97815215', this.handle); } N_0x4F81EAD1DE8FA19B(): void { inv('0x4F81EAD1DE8FA19B', this.handle); } /** * @param p1 * @returns */ forceSpawnPerschar(p1: boolean): Entity | null { return createFromHandle('Entity', inv('0x0CADC3A977997472', this.handle, p1, rai())); } /** * @returns */ get PedIndex(): Ped | null { return createFromHandle('Ped', inv('0x31C70A716CAE1FEE', this.handle, rai())); } retaskPersistentCharacter(): void { inv('0x631CD2D77FDC0316', this.handle); } N_0xFCC6DB8DBE709BC8(): void { inv('0xFCC6DB8DBE709BC8', this.handle); } N_0xA8C406C2A56EDC16(): void { inv('0xA8C406C2A56EDC16', this.handle); } /** * @returns */ get IsPersistentCharacterDead(): boolean { return !!inv('0xEB98B38CA60742D7', this.handle, rai()); } N_0x6759BEE6762E140B(): void { inv('0x6759BEE6762E140B', this.handle); } N_0xB65E7F733956CF25(): void { inv('0xB65E7F733956CF25', this.handle); } forceDespawnPerschar(): void { inv('0x7B204F88F6C3D287', this.handle); } deletePerschar(): void { inv('0xFC77C5B44D5FF7C0', this.handle); } N_0xBB68908CD11AEBDC(): void { inv('0xBB68908CD11AEBDC', this.handle); } /** * @returns */ get IsPersistentCharacterValid(): boolean { return !!inv('0x800DF3FC913355F3', this.handle, rai()); } } registerHandle('PersChar', PersChar);