import type { eWeaponHash } from '../enums/eWeaponHash'; import type { Entity } from '../classes/Entity'; import type { Ped } from '../classes/Ped'; import type { Vehicle } from '../classes/Vehicle'; 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 Player implements IHandle { constructor(public handle: number) {} static fromHandle(handle: number): Player | null { return handle === 0 ? null : new Player(handle); } /** * @param p2 * @param p3 * @returns outEntity */ getInteractionTargetEntity(p2: boolean, p3: boolean): [any, Entity | null] { const result = inv<[number, number]>('0x3EE1F7A8C32F24E1', this.handle, pvi(), p2, p3); return [result[0], createFromHandle('Entity', result[1])]; } /** * @param toggle */ set DeadeyeTaggingEnabled(toggle: boolean) { inv('0x6B5DDFB967E5073D', this.handle, toggle); } /** * @param toggle * @returns The instance for method chaining */ setDeadeyeTaggingEnabled(toggle: boolean): this { inv('0x6B5DDFB967E5073D', this.handle, toggle); return this; } /** * @returns */ get Stamina(): float { return inv('0x0FF421E467373FCF', this.handle, raf()); } /** * @param modifier */ set MeleeWeaponDamageModifier(modifier: float) { inv('0xE4CB5A3F18170381', this.handle, f(modifier)); } /** * @param modifier * @returns The instance for method chaining */ setMeleeWeaponDamageModifier(modifier: float): this { inv('0xE4CB5A3F18170381', this.handle, f(modifier)); return this; } /** * @returns */ hasBeenSpottedInStolenVehicle(): boolean { return !!inv('0xC932F57F31EA9152', this.handle, rai()); } /** * Enables or disables the Pick Up prompt for a hat on the ground for the specified player. When set to true, the player will see a prompt to pick up the hat if they are near it. * * @param canPickup */ set CanPickupHat(canPickup: boolean) { inv('0xACA45DDCEF6071C4', this.handle, canPickup); } /** * Enables or disables the Pick Up prompt for a hat on the ground for the specified player. When set to true, the player will see a prompt to pick up the hat if they are near it. * * @param canPickup * @returns The instance for method chaining */ setCanPickupHat(canPickup: boolean): this { inv('0xACA45DDCEF6071C4', this.handle, canPickup); return this; } /** * Sets the aura color for entities that the player can target in Deadeye mode, based on a specific hash value. This Native was previously named `SetPlayerStatFlagHash`, but it has been re-evaluated and renamed to better reflect its function in controlling the Deadeye aura color for targeted entities * some colors * 0: Default aura * 1014693585 * 1936842089 * 1979474018 * * @param auraColorHash */ set DeadEyeAuraByHash(auraColorHash: string | number) { inv('0x768E81AE285A4B67', this.handle, _h(auraColorHash)); } /** * Sets the aura color for entities that the player can target in Deadeye mode, based on a specific hash value. This Native was previously named `SetPlayerStatFlagHash`, but it has been re-evaluated and renamed to better reflect its function in controlling the Deadeye aura color for targeted entities * some colors * 0: Default aura * 1014693585 * 1936842089 * 1979474018 * * @param auraColorHash * @returns The instance for method chaining */ setDeadEyeAuraByHash(auraColorHash: string | number): this { inv('0x768E81AE285A4B67', this.handle, _h(auraColorHash)); return this; } /** * @param disabled */ specialAbilitySetDisabled(disabled: boolean): void { inv('0xAE637BB8EF017875', this.handle, disabled); } /** * @param ammoType * @param amount * @returns The instance for method chaining */ setMaxAmmoOverrideForAmmoType(ammoType: string | number, amount: int): this { inv('0xE133C1EC5300F740', this.handle, _h(ammoType), amount); return this; } /** * @param p1 */ eagleEyeSetTrackingUpgrade2(p1: float): void { inv('0x6FA957D1B55941C1', this.handle, f(p1)); } /** * @returns The instance for method chaining */ setAllNeutralRandomPedsFleeThisFrame(): this { inv('0x16752DAA7E6D3F72', this.handle); return this; } /** * @param p1 */ restoreStamina(p1: float): void { inv('0xC41F4B6E23FE6A4A', this.handle, f(p1)); } /** * @returns */ get CachedDeadEyeAmount(): float { return inv('0xDF66A37936D5F3D9', this.handle, raf()); } clearHasDamagedAtLeastOnePed(): void { inv('0x270B63A641BE32F2', this.handle); } /** * @param entity * @param p2 * @returns */ isTargettingEntity(entity: Entity, p2: boolean): boolean { return !!inv('0x27F89FDC16688A7A', this.handle, entity.handle, p2, rai()); } /** * If player has less Dead Eye than required, Dead Eye cant be triggered. * * @returns */ get RequiredDeadEyeAmount(): float { return inv('0x811A748B1BE231BA', this.handle, raf()); } /** * @param p1 */ N_0x263D69767F76059C(p1: int): void { inv('0x263D69767F76059C', this.handle, p1); } /** * Make sure to request the model first and wait until it has loaded. * * @param modelHash * @param p2 * @returns The instance for method chaining */ setModel(modelHash: string | number, p2: boolean): this { inv('0xED40380076A31506', this.handle, _h(modelHash), p2); return this; } /** * @param toggle */ set Lockon(toggle: boolean) { inv('0x462AA1973CBBA75E', this.handle, toggle); } /** * @param toggle * @returns The instance for method chaining */ setLockon(toggle: boolean): this { inv('0x462AA1973CBBA75E', this.handle, toggle); return this; } /** * Sets the player's ability to wear hats based on the specified flag. The flag value determines whether the player can wear all hats or only the ones they own. * If the flag is set to 15 and `allow` is true, the player can wear all available hats. However, if you want to restrict the player to wearing only their owned hats (flag 1), you **must first** disable flag 15 by setting it to false, and then set flag 1 to true. * * @param flag * @param allow * @returns The instance for method chaining */ setHatAccess(flag: int, allow: boolean): this { inv('0xA0C683284DF027C7', this.handle, flag, allow); return this; } /** * @param closeDamageBonus */ set DamageCloseDistanceBonusTotal(closeDamageBonus: float) { inv('0x5006C36652D6EC56', this.handle, f(closeDamageBonus)); } /** * @param closeDamageBonus * @returns The instance for method chaining */ setDamageCloseDistanceBonusTotal(closeDamageBonus: float): this { inv('0x5006C36652D6EC56', this.handle, f(closeDamageBonus)); return this; } /** * Params: p1 = -1 in R* Scripts * * @param p1 * @param p2 */ specialAbilityStartRestore(p1: int, p2: boolean): void { inv('0x1D77B47AFA584E90', this.handle, p1, p2); } /** * @param multiplier */ set StaminaSprintDepletionMultiplier(multiplier: float) { inv('0xBBADFB5E5E5766FB', this.handle, f(multiplier)); } /** * @param multiplier * @returns The instance for method chaining */ setStaminaSprintDepletionMultiplier(multiplier: float): this { inv('0xBBADFB5E5E5766FB', this.handle, f(multiplier)); return this; } /** * @param p1 */ eagleEyeSetTrackingUpgrade(p1: float): void { inv('0xDFC85C5199045026', this.handle, f(p1)); } /** * Get the entity the player is aiming at with/without weapon. * * @returns entity */ get InteractionAimEntity(): [boolean, Entity | null] { const result = inv<[boolean, number]>('0xBEA3A6E5F5F79A6F', this.handle, pvi(), rai()); return [!!result[0], createFromHandle('Entity', result[1])]; } /** * @param modifier */ set WeaponDefenseModifier(modifier: float) { inv('0xD15CC2D493160BE3', this.handle, f(modifier)); } /** * @param modifier * @returns The instance for method chaining */ setWeaponDefenseModifier(modifier: float): this { inv('0xD15CC2D493160BE3', this.handle, f(modifier)); return this; } /** * @returns */ hasDamagedAtLeastOneNonAnimalPed(): boolean { return !!inv('0x16C8D205DD5A2E90', this.handle, rai()); } /** * @returns */ get DeadeyeAbilityLevel(): int { return inv('0xCCE7C695C164C35F', this.handle, rai()); } /** * This native is used to determine if the player has an active lockon an entity while riding a horse. * * @returns */ get IsOnMountLockonEntity(): boolean { return !!inv('0x2009F8AB7A5E9D6D', this.handle, rai()); } suppressWitnessesCallingPoliceThisFrame(): void { inv('0x96722257E5381E00', this.handle); } /** * bullet damage modifier: type = 4 * explosive damage Defense mod: type = 7 * fire damage Defense mod: type = 8, 15 * * @param type * @param defenseModifier * @returns The instance for method chaining */ setDefenseTypeModifier(type: int, defenseModifier: float): this { inv('0x93F499CAE53FCD05', this.handle, type, f(defenseModifier)); return this; } /** * *CLEAR_FACIAL** - _CLEAR_PED_BLOOD* */ N_0xF21C7A3F3FFBA629(): void { inv('0xF21C7A3F3FFBA629', this.handle); } /** * Associates a specific interactive focus mode preset between a player and a ped, with a specified location and target entity. * To access all available presets, refer to the file located at: `/update_1.rpf/common/data/interactive_focus_mode_presets.meta` * * @param ped * @param preset * @param pos * @param targetEntity * @param name */ addAmbientInteractiveFocusPreset(ped: Ped, preset: string, pos: Vector3, targetEntity: Entity, name: string): void { inv('0x3946FC742AC305CD', this.handle, ped.handle, preset, f(pos.x), f(pos.y), f(pos.z), targetEntity.handle, name); } /** * Resets any aura effects applied to entities for a specific player in Deadeye mode, returning all aura-related visuals to their default state. This function is primarily used to remove any highlighting or aura effects set by `_SET_DEADEYE_ENTITY_AURA_WITH_FLAG - 0x2B12B6FC8B8772AB` and `_SET_DEADEYE_ENTITY_AURA_INTENSITY_WITH_FLAG - 0x131E294EF60160DF` */ resetDeadeyeAuraEffect(): void { inv('0xE910932F4B30BE23', this.handle); } /** * @param accuracy */ set TotalAccuracyModifier(accuracy: float) { inv('0x967FF5BC0CFE6D26', this.handle, f(accuracy)); } /** * @param accuracy * @returns The instance for method chaining */ setTotalAccuracyModifier(accuracy: float): this { inv('0x967FF5BC0CFE6D26', this.handle, f(accuracy)); return this; } /** * @returns */ get VehicleOwnedByPlayer(): Vehicle | null { return createFromHandle('Vehicle', inv('0xB9050A97594C8832', this.handle, rai())); } /** * Activates EagleEye, called together with 0x28A13BF6B05C3D83 */ secondarySpecialAbilitySetActive(): void { inv('0x1710BC33CFB83634', this.handle); } /** * _GET_A* - _GET_C* * * @returns */ N_0x927861B2C08DBEA5(): boolean { return !!inv('0x927861B2C08DBEA5', this.handle, rai()); } /** * it is used to check for that period of time if player damaged any peds only returns the last 3 hits with the entity ids so if you hit the same entity 3 times it will return the same entity id 3 times, if you hit 4 different entities within that time it will return the last 3 entity ids * only stores the last 3 hits in the data view buffer * duration is in miliseconds * you need dataview * * @param duration * @returns struct * @example * ```lua * Citizen.InvokeNative(0x1A6E84F13C952094, PlayerId(), 10000, dataView:Buffer()) * local entity = dataView:GetInt32(8 * 1) * local entity2 = dataView:GetInt32(8 * 2) * local entity3 = dataView:GetInt32(8 * 3) * print(entity, entity2, entity3) * ``` */ getPedsDamagedByRecently(duration: int): [boolean, number] { const result = inv<[boolean, number]>('0x1A6E84F13C952094', this.handle, duration, pvi(), rai()); return [!!result[0], result[1]]; } /** * @param multiplier */ set StaminaRechargeMultiplier(multiplier: float) { inv('0xFECA17CF3343694B', this.handle, f(multiplier)); } /** * @param multiplier * @returns The instance for method chaining */ setStaminaRechargeMultiplier(multiplier: float): this { inv('0xFECA17CF3343694B', this.handle, f(multiplier)); return this; } /** * Deactivates EagleEye, called together with 0xC0B21F235C02139C * * @param disabled */ secondarySpecialAbilitySetDisabled(disabled: boolean): void { inv('0x64FF4BF9AF59E139', this.handle, disabled); } /** * @returns */ updateTeleport(): boolean { return !!inv('0xC39DCE4672CBFBC1', this.handle, rai()); } resetInputGait(): void { inv('0x61A2EECAB274829B', this.handle); } /** * Activates the special ability for the specified player. */ specialAbilitySetActivate(): void { inv('0xBBA140062B15A8AC', this.handle); } clearHasDamagedAtLeastOneNonAnimalPed(): void { inv('0x0361096D6CE4372C', this.handle); } /** * @param modifier */ set WeaponDegradationModifier(modifier: float) { inv('0x11A7FF918EF6BC66', this.handle, f(modifier)); } /** * @param modifier * @returns The instance for method chaining */ setWeaponDegradationModifier(modifier: float): this { inv('0x11A7FF918EF6BC66', this.handle, f(modifier)); return this; } /** * Only used in R* SP Script short_update * * @param timer */ set SpecialAbilityDisableTimer(timer: float) { inv('0xC0B1C05B313693D1', this.handle, f(timer)); } /** * Only used in R* SP Script short_update * * @param timer * @returns The instance for method chaining */ setSpecialAbilityDisableTimer(timer: float): this { inv('0xC0B1C05B313693D1', this.handle, f(timer)); return this; } /** * @param abilityType * @param toggle * @returns The instance for method chaining */ setDeadeyeAbilityLocked(abilityType: int, toggle: boolean): this { inv('0x2797B8D66DD0EBB8', this.handle, abilityType, toggle); return this; } /** * playerResetFlag: See 0x9F9A829C6751F3C7 * * @param playerResetFlag * @returns */ getResetFlag(playerResetFlag: int): any { return inv('0xFE691E89C08937B6', this.handle, playerResetFlag); } /** * Returns TRUE if the player ('s ped) is climbing at the moment. * * @returns */ get IsClimbing(): boolean { return !!inv('0xB8A70C22FD48197A', this.handle, rai()); } /** * @returns Refer to {@link ePedMood} */ get Mood(): int { return inv('0x054473164C012699', this.handle, rai()); } clearBountyTarget(): void { inv('0x8F2A81C09DA9124A', this.handle); } /** * Focus Fire VFX start for player: p1 = focusfire * * @param p1 */ set LockonFocusFireVfx(p1: string) { inv('0x5F8E0303C229C84B', this.handle, p1); } /** * Focus Fire VFX start for player: p1 = focusfire * * @param p1 * @returns The instance for method chaining */ setLockonFocusFireVfx(p1: string): this { inv('0x5F8E0303C229C84B', this.handle, p1); return this; } /** * Params: https://github.com/Halen84/RDR3-Native-Flags-And-Enums/tree/main/ePromptType * promptType is mostly 34 (PP_TRACK_ANIMAL), promptMode = 0 (PP_MODE_BLOCK) in R* Scripts * * @param promptType * @param promptMode * @param disabled */ modifyUiPrompt(promptType: int, promptMode: int, disabled: boolean): void { inv('0x0751D461F06E41CE', this.handle, promptType, promptMode, disabled); } /** * @param p1 * @returns */ getMaxDeadEye(p1: any): float { return inv('0x592F58BC4D2A2CF3', this.handle, p1, raf()); } /** * @param toggle * @param ped * @param p3 * @param p4 * @returns The instance for method chaining */ setForcedAim(toggle: boolean, ped: Ped, p3: int, p4: boolean): this { inv('0xD5FCC166AEB2FD0F', this.handle, toggle, ped.handle, p3, p4); return this; } N_0x93624B36E8851B42(): void { inv('0x93624B36E8851B42', this.handle); } /** * @param abilityType * @returns */ isDeadeyeAbilityLocked(abilityType: int): boolean { return !!inv('0x8A0643B0B4CA276B', this.handle, abilityType, rai()); } /** * @param ped * @param useSteerassist */ N_0x1FDA57E8908F2609(ped: Ped, useSteerassist: boolean): void { inv('0x1FDA57E8908F2609', this.handle, ped.handle, useSteerassist); } /** * Returns Deadeye value from player * * @returns */ specialAbilityGetAmountCached(): float { return inv('0x029884FB65821B07', this.handle, raf()); } /** * @param vehicle */ set OwnsVehicle(vehicle: Vehicle) { inv('0xD0E02AA618020D17', this.handle, vehicle.handle); } /** * @param vehicle * @returns The instance for method chaining */ setOwnsVehicle(vehicle: Vehicle): this { inv('0xD0E02AA618020D17', this.handle, vehicle.handle); return this; } /** * @returns */ hasDamagedAtLeastOnePed(): boolean { return !!inv('0xDA4A4B9B96E20092', this.handle, rai()); } /** * Seems to enable active horse equipment prompt when being near it and enables the control that opens the inventory as well * * @param mount */ set OwnsMount(mount: Ped) { inv('0xE6D4E435B56D5BD0', this.handle, mount.handle); } /** * Seems to enable active horse equipment prompt when being near it and enables the control that opens the inventory as well * * @param mount * @returns The instance for method chaining */ setOwnsMount(mount: Ped): this { inv('0xE6D4E435B56D5BD0', this.handle, mount.handle); return this; } /** * nullsub, doesn't do anything */ clearWantedLevel(): void { inv('0x4E4B996C928C7AA6', this.handle); } /** * Does the same like PLAYER::GET_PLAYER_PED * * @returns */ get PedScriptIndex(): Ped | null { return createFromHandle('Ped', inv('0x5C880F9056D784C8', this.handle, rai())); } /** * Retrieves the ID of the ped that the specified player is currently tracking while in Eagle Eye mode. * * @returns */ eagleEyeGetTrackedPedId(): any { return inv('0x3813E11A378958A5', this.handle); } /** * @returns Returns the player name, or if the player doesn't exist, it returns "**Invalid**" */ get Name(): string { return inv('0x7124FD9AC0E01BA0', this.handle, ras()); } /** * Seems to work similar to 0xD2CB0FB0FDCB473D * * @param horse */ set PedActiveHorse(horse: Ped) { inv('0x8FBF9EDB378CCB8C', this.handle, horse.handle); } /** * Seems to work similar to 0xD2CB0FB0FDCB473D * * @param horse * @returns The instance for method chaining */ setPedActiveHorse(horse: Ped): this { inv('0x8FBF9EDB378CCB8C', this.handle, horse.handle); return this; } /** * Name could potentially be inaccurate. * Used in Script Function HORSE_SETUP_PLAYER_HORSE_ATTRIBUTES (p1 = true) * _SET_PLAYER_L* - _SET_PLAYER_M* * * @param active */ set MountStateActive(active: boolean) { inv('0xDF93973251FB2CA5', this.handle, active); } /** * Name could potentially be inaccurate. * Used in Script Function HORSE_SETUP_PLAYER_HORSE_ATTRIBUTES (p1 = true) * _SET_PLAYER_L* - _SET_PLAYER_M* * * @param active * @returns The instance for method chaining */ setMountStateActive(active: boolean): this { inv('0xDF93973251FB2CA5', this.handle, active); return this; } /** * _IS_PLAYER_I* - _IS_PLAYER_P* * * @returns p1 */ N_0xB331D8A73F9D2BDF(): [boolean, number] { const result = inv<[boolean, number]>('0xB331D8A73F9D2BDF', this.handle, pvi(), rai()); return [!!result[0], result[1]]; } /** * Inhibits the player from using any method of combat including melee and firearms. NOTE: Only disables the firing for one frame * * @param toggle */ disableFiring(toggle: boolean): void { inv('0x2970929FD5F9FC89', this.handle, toggle); } specialAbilitySetEagleEyeDisabled(): void { inv('0xC0B21F235C02139C', this.handle); } /** * Sets the sit prompt for a specific player using a predefined text entry. use game strings like PLAYER_SIT or use custom with * AddTextEntry("sit_custom", "Take a seat") * this native must be invoked * https://imgur.com/gallery/0x988c9045531b9fce-9bTHgkv * * @param label */ set SitPromptText(label: string) { inv('0x988C9045531B9FCE', this.handle, label); } /** * Sets the sit prompt for a specific player using a predefined text entry. use game strings like PLAYER_SIT or use custom with * AddTextEntry("sit_custom", "Take a seat") * this native must be invoked * https://imgur.com/gallery/0x988c9045531b9fce-9bTHgkv * * @param label * @returns The instance for method chaining */ setSitPromptText(label: string): this { inv('0x988C9045531B9FCE', this.handle, label); return this; } updateWantedPositionThisFrame(): void { inv('0xD0B0B044112BF424', this.handle); } /** * @param entity */ unregisterEagleEyeForEntity(entity: Entity): void { inv('0x9DAE1380CC5C6451', this.handle, entity.handle); } /** * @param farRangeLowerBound * @param farRangeUpperBound * @returns The instance for method chaining */ setDamageFarDistanceBonus(farRangeLowerBound: float, farRangeUpperBound: float): this { inv('0xED591CB17C8BA216', this.handle, f(farRangeLowerBound), f(farRangeUpperBound)); return this; } /** * Sets the melee combat prompt for a specific player using a predefined text entry. use game string or * AddTextEntry("custom_text", "Throw a punch") and use custom_text in the native * * @param label */ set MeleePromptText(label: string) { inv('0x0FAF95D71ED67ADE', this.handle, label); } /** * Sets the melee combat prompt for a specific player using a predefined text entry. use game string or * AddTextEntry("custom_text", "Throw a punch") and use custom_text in the native * * @param label * @returns The instance for method chaining */ setMeleePromptText(label: string): this { inv('0x0FAF95D71ED67ADE', this.handle, label); return this; } /** * Used in script function INIT_DEADEYE_SLOWDOWN * * @param p1 */ N_0x570A13A4CA2799BB(p1: boolean): void { inv('0x570A13A4CA2799BB', this.handle, p1); } /** * @param activationCost * @param p2 * @returns The instance for method chaining */ setSpecialAbilityActivationCost(activationCost: float, p2: int): this { inv('0xAE4BCC79C587EBBF', this.handle, f(activationCost), p2); return this; } /** * Used for setting up eagle eye for entity * Params: p2 = re-register or not? * * @param entity * @param p2 */ registerEagleEyeForEntity(entity: Entity, p2: boolean): void { inv('0x543DFE14BE720027', this.handle, entity.handle, p2); } /** * @param p1 */ N_0x22B3CABEDDB538B2(p1: float): void { inv('0x22B3CABEDDB538B2', this.handle, f(p1)); } /** * @param modifier */ set ExplosiveWeaponDamageModifier(modifier: float) { inv('0x2D3ACE3DE0A2B622', this.handle, f(modifier)); } /** * @param modifier * @returns The instance for method chaining */ setExplosiveWeaponDamageModifier(modifier: float): this { inv('0x2D3ACE3DE0A2B622', this.handle, f(modifier)); return this; } /** * returns true if the player is on a road while riding a horse but at a certain speed, if you go off road then it returns false or if you go too slow like walking state it also returns false * * @returns */ get IsMountOnRoad(): boolean { return !!inv('0xE631EAF35828FA67', this.handle, rai()); } /** * @param entity * @returns */ isEagleEyeRegisteredForEntity(entity: Entity): boolean { return !!inv('0x0E6846476906C9DD', this.handle, entity.handle, rai()); } /** * Max level is 5. * * @param level */ set DeadeyeAbilityLevel(level: int) { inv('0xF0FE8E790BFEB5BB', this.handle, level); } /** * Max level is 5. * * @param level * @returns The instance for method chaining */ setDeadeyeAbilityLevel(level: int): this { inv('0xF0FE8E790BFEB5BB', this.handle, level); return this; } /** * Shows or hides all Pick Up prompts for the specified player, including the prompt for picking up hats from the ground. When set to true, the player will see Pick Up prompts for all nearby items. If set to false, all Pick Up prompts will be hidden. * * @param enable */ set PickupPromptVisible(enable: boolean) { inv('0xD1A70C1E8D1031FE', this.handle, enable); } /** * Shows or hides all Pick Up prompts for the specified player, including the prompt for picking up hats from the ground. When set to true, the player will see Pick Up prompts for all nearby items. If set to false, all Pick Up prompts will be hidden. * * @param enable * @returns The instance for method chaining */ setPickupPromptVisible(enable: boolean): this { inv('0xD1A70C1E8D1031FE', this.handle, enable); return this; } /** * @param mount */ set PedAsSaddleHorseForPlayer(mount: Ped) { inv('0xD2CB0FB0FDCB473D', this.handle, mount.handle); } /** * @param mount * @returns The instance for method chaining */ setPedAsSaddleHorseForPlayer(mount: Ped): this { inv('0xD2CB0FB0FDCB473D', this.handle, mount.handle); return this; } /** * @returns */ get ActiveHorseForPlayer(): Ped | null { return createFromHandle('Ped', inv('0x46FA0AE18F4C7FA9', this.handle, rai())); } /** * @param entity * @param p2 */ unregisterEagleEyeTrailsForEntity(entity: Entity, p2: any): void { inv('0x9A957912CE2EABD1', this.handle, entity.handle, p2); } /** * Resetter for 0x4DBC4873707E8FD6, sets x, y, z to 1.0 */ N_0xCEDC16930526F728(): void { inv('0xCEDC16930526F728', this.handle); } /** * @param ped * @param p2 */ N_0xDD33A82352C4652F(ped: Ped, p2: int): void { inv('0xDD33A82352C4652F', this.handle, ped.handle, p2); } /** * _RESET_PLAYER_A* - _RESET_PLAYER_I* */ N_0x1F488807BC8E0630(): void { inv('0x1F488807BC8E0630', this.handle); } /** * @param p1 */ N_0x4EC8BE63B8A5D4EF(p1: int): void { inv('0x4EC8BE63B8A5D4EF', this.handle, p1); } /** * @returns */ canStartMission(): boolean { return !!inv('0x2DF170B1185AF777', this.handle, rai()); } /** * Adds an interactive focus mode preset between a player and a specific set of coordinates with a target entity. * To access all available presets, refer to the file located at:update_1.rpf.common.data.interactive_focus_mode_presets.meta * * @param preset * @param pos * @param targetEntity * @param name * @returns p1 * @example * ```lua * AddPlayerInteractiveFocusPresetAtCoords(PlayerId(),GetEntityCoords(PlayerPedId()),'ForcedILONoIcon',0.0,0.0,0.0,PlayerPedId(),'text') * ``` */ addAmbientInteractiveFocusPresetAtCoords(preset: string, pos: Vector3, targetEntity: Entity, name: string): Vector3 { const result = inv('0xD48227263E3D06AE', this.handle, pvv(), preset, f(pos.x), f(pos.y), f(pos.z), targetEntity.handle, name); return Vector3.fromArray(result); } /** * @returns */ get StaminaRechargeMultiplier(): float { return inv('0x617D3494AD58200F', this.handle, raf()); } /** * Returns the depletion delay value for the Deadeye ability that was previously set using `SetDeadeyeAbilityDepletionDelay - 0x870634493CB4372C` * * @returns */ get DeadeyeAbilityDepletionDelay(): any { return inv('0xE92261BD28C0878F', this.handle); } /** * @returns */ get IsReadyForCutscene(): boolean { return !!inv('0xAA67BCB0097F2FA3', this.handle, rai()); } /** * @param p1 */ N_0x216BC0D3D2E413D2(p1: any): void { inv('0x216BC0D3D2E413D2', this.handle, p1); } /** * nullsub, doesn't do anything * * @param wantedLevel * @param disableNoMission * @returns The instance for method chaining */ setWantedLevel(wantedLevel: int, disableNoMission: boolean): this { inv('0x384D4765395E006C', this.handle, wantedLevel, disableNoMission); return this; } /** * false: default eagleeye color * true: green eagleeye color * * @param p1 * @returns p2 */ eagleEyeSetColor(p1: boolean): number { const result = inv('0x2C41D93F550D5E37', this.handle, p1, pvi()); return result; } /** * *SET_PLAYER_DAMAGE** - *SET_PLAYER_DEFENSE** * * @param p1 */ N_0x818241B3EDA84191(p1: boolean): void { inv('0x818241B3EDA84191', this.handle, p1); } /** * @returns */ get Ped(): Ped | null { return createFromHandle('Ped', inv('0x275F255ED201B937', this.handle, rai())); } /** * Sets whether all random peds will run away from player if they are agitated (threatened) (bool=true), or some peds can stand up for themselves (bool=false). * * @param toggle */ set AllRandomPedsFlee(toggle: boolean) { inv('0xE705309B8C6445A4', this.handle, toggle); } /** * Sets whether all random peds will run away from player if they are agitated (threatened) (bool=true), or some peds can stand up for themselves (bool=false). * * @param toggle * @returns The instance for method chaining */ setAllRandomPedsFlee(toggle: boolean): this { inv('0xE705309B8C6445A4', this.handle, toggle); return this; } /** * @param p1 * @param discoveryHash * @returns The instance for method chaining */ setHasDiscoveredCharacterNameSp(p1: int, discoveryHash: string | number): this { inv('0x946D46CD6DFB9742', this.handle, p1, _h(discoveryHash)); return this; } /** * @returns entity */ get EntityIsFreeAimingAt(): [boolean, Entity | null] { const result = inv<[boolean, number]>('0xA6817C110B830EAD', this.handle, pvi(), rai()); return [!!result[0], createFromHandle('Entity', result[1])]; } /** * @returns */ get TempHorse(): Ped | null { return createFromHandle('Ped', inv('0xD3F7445CEA2E5035', this.handle, rai())); } /** * this native checks if the player has damaged or killed any ped human/animal recently within the duration passed, either by shooting or even using melee * duration is in miliseconds * * @param duration * @returns */ hasDamagedAnyPedRecently(duration: int): boolean { return !!inv('0x72AD59F7B7FB6E24', this.handle, duration, rai()); } /** * @returns entity */ get TargetEntity(): [boolean, Entity | null] { const result = inv<[boolean, number]>('0xAE663DDD99C8A670', this.handle, pvi(), rai()); return [!!result[0], createFromHandle('Entity', result[1])]; } /** * @returns Returns true if the ped has a ped, and the ped is alive and not arrested. */ get IsPlaying(): boolean { return !!inv('0xBFFB35986CAAE58C', this.handle, rai()); } /** * @returns */ get SaddleHorseForPlayer(): Ped | null { return createFromHandle('Ped', inv('0xB48050D326E9A2F3', this.handle, rai())); } /** * Affects the range of auto aim target. * * @param range */ set LockonRangeOverride(range: float) { inv('0x3A3CD06597388322', this.handle, f(range)); } /** * Affects the range of auto aim target. * * @param range * @returns The instance for method chaining */ setLockonRangeOverride(range: float): this { inv('0x3A3CD06597388322', this.handle, f(range)); return this; } /** * @returns */ get HuntingWagon(): Vehicle | null { return createFromHandle('Vehicle', inv('0x5CA6BBD4A7D8145E', this.handle, rai())); } /** * @param modifier */ set TrampleDamageModifier(modifier: float) { inv('0xAF341032E97FB061', this.handle, f(modifier)); } /** * @param modifier * @returns The instance for method chaining */ setTrampleDamageModifier(modifier: float): this { inv('0xAF341032E97FB061', this.handle, f(modifier)); return this; } /** * Checks if player is focused on any entity * * @returns */ get IsFreeFocusing(): boolean { return !!inv('0x1A51BFE60708E482', this.handle, rai()); } /** * flags: https://github.com/Halen84/RDR3-Native-Flags-And-Enums/tree/main/eSetPlayerControlFlags * * @param toggle * @param flags * @param bPreventHeadingChange * @returns The instance for method chaining */ setControl(toggle: boolean, flags: int, bPreventHeadingChange: boolean): this { inv('0x4D51E59243281D80', this.handle, toggle, flags, bPreventHeadingChange); return this; } /** * Returns true if eagle eye is enabled for the player * * @returns */ get IsSecondarySpecialAbilityEnabled(): boolean { return !!inv('0xE022CC1B545F1D9F', this.handle, rai()); } /** * @param multiplier */ set NoiseMultiplier(multiplier: float) { inv('0xB5EC6BDAEBCA454C', this.handle, f(multiplier)); } /** * @param multiplier * @returns The instance for method chaining */ setNoiseMultiplier(multiplier: float): this { inv('0xB5EC6BDAEBCA454C', this.handle, f(multiplier)); return this; } /** * Gets a value indicating whether the specified player is currently aiming freely. * * @returns */ get IsFreeAiming(): boolean { return !!inv('0x936F967D4BE1CE9D', this.handle, rai()); } /** * @param showingInfoCard */ set ShowInfoCard(showingInfoCard: boolean) { inv('0xDC68829BB3F37023', this.handle, showingInfoCard); } /** * @param showingInfoCard * @returns The instance for method chaining */ setShowInfoCard(showingInfoCard: boolean): this { inv('0xDC68829BB3F37023', this.handle, showingInfoCard); return this; } /** * @param regenRate */ set HealthRechargeMultiplier(regenRate: float) { inv('0x8899C244EBCF70DE', this.handle, f(regenRate)); } /** * @param regenRate * @returns The instance for method chaining */ setHealthRechargeMultiplier(regenRate: float): this { inv('0x8899C244EBCF70DE', this.handle, f(regenRate)); return this; } /** * damageInfo: STANDARD_PED_DAMAGE, STANDARD_FEMALE_PED_DAMAGE, STANDARD_PLAYER_PED_DAMAGE_MP, STANDARD_FEMALE_PLAYER_PED_DAMAGE_MP * * @param damageInfo */ set DamageInfoOverride(damageInfo: string) { inv('0x78B3D19AF6391A55', this.handle, damageInfo); } /** * damageInfo: STANDARD_PED_DAMAGE, STANDARD_FEMALE_PED_DAMAGE, STANDARD_PLAYER_PED_DAMAGE_MP, STANDARD_FEMALE_PLAYER_PED_DAMAGE_MP * * @param damageInfo * @returns The instance for method chaining */ setDamageInfoOverride(damageInfo: string): this { inv('0x78B3D19AF6391A55', this.handle, damageInfo); return this; } /** * Sets whether this player can be hassled by gangs. * * @param toggle */ set CanBeHassledByGangs(toggle: boolean) { inv('0xC7FE774412046825', this.handle, toggle); } /** * Sets whether this player can be hassled by gangs. * * @param toggle * @returns The instance for method chaining */ setCanBeHassledByGangs(toggle: boolean): this { inv('0xC7FE774412046825', this.handle, toggle); return this; } /** * Clears the intensity of aura effects applied to entities for a specific player in Deadeye mode based on a flag parameter. This function is used to reset any intensity modifications set by `_SET_DEADEYE_ENTITY_AURA_INTENSITY_WITH_FLAG - 0x131E294EF60160DF`, restoring affected entities' aura intensity to their default state. * * @param bitflag */ clearDeadeyeAuraIntensityWithFlag(bitflag: int): void { inv('0x0E9057A9DA78D0F8', this.handle, bitflag); } /** * Decreases Stamina bar drain speed by % when drawing a bow. * * @param staminaDrain */ set BowStaminaDrainSpeed(staminaDrain: float) { inv('0xFE7C9CF376D23342', this.handle, f(staminaDrain)); } /** * Decreases Stamina bar drain speed by % when drawing a bow. * * @param staminaDrain * @returns The instance for method chaining */ setBowStaminaDrainSpeed(staminaDrain: float): this { inv('0xFE7C9CF376D23342', this.handle, f(staminaDrain)); return this; } /** * @returns The instance for method chaining */ setAllRandomPedsFleeThisFrame(): this { inv('0xD5C198A62F1DEB0A', this.handle); return this; } /** * Unsure what it does, sets a Vector on the CPlayerInfo but it doesn't? look like its used anywhere * * @param pos */ N_0x4DBC4873707E8FD6(pos: Vector3): void { inv('0x4DBC4873707E8FD6', this.handle, f(pos.x), f(pos.y), f(pos.z)); } /** * _SET_PLAYER_A* - _SET_PLAYER_C* * * @param damage */ set LassoDamagePerSecond(damage: float) { inv('0x43F50A7CD2482156', this.handle, f(damage)); } /** * _SET_PLAYER_A* - _SET_PLAYER_C* * * @param damage * @returns The instance for method chaining */ setLassoDamagePerSecond(damage: float): this { inv('0x43F50A7CD2482156', this.handle, f(damage)); return this; } /** * Return true while player is being arrested / busted. If atArresting is set to 1, this function will return 1 when player is being arrested (while player is putting his hand up, but still have control) If atArresting is set to 0, this function will return 1 only when the busted screen is shown. * * @param atArresting * @returns */ isBeingArrested(atArresting: boolean): boolean { return !!inv('0xC8183AE963C58374', this.handle, atArresting, rai()); } /** * Gets a value indicating whether the specified player is currently aiming freely at the specified entity. * * @param entity * @returns */ isFreeAimingAtEntity(entity: Entity): boolean { return !!inv('0x8C67C11C68713D25', this.handle, entity.handle, rai()); } /** * @param farDamageBonus */ set DamageFarDistanceBonusTotal(farDamageBonus: float) { inv('0x1F0E3A4434565F8F', this.handle, f(farDamageBonus)); } /** * @param farDamageBonus * @returns The instance for method chaining */ setDamageFarDistanceBonusTotal(farDamageBonus: float): this { inv('0x1F0E3A4434565F8F', this.handle, f(farDamageBonus)); return this; } /** * @returns The instance for method chaining */ setMayNotEnterAnyVehicle(): this { inv('0xBEC463B3A11C909E', this.handle); return this; } /** * @returns */ get Health(): float { return inv('0x0317C947D062854E', this.handle, raf()); } resetWantedLevelDifficulty(): void { inv('0x062D14F18E8B0CAE', this.handle); } /** * @param linkedWaypointPed */ eagleEyeSetFocusOnAssociatedClueTrail(linkedWaypointPed: Entity): void { inv('0x2AF423D6ECB2C485', this.handle, linkedWaypointPed.handle); } /** * @returns */ get NumMarkedDeadeyeTargets(): int { return inv('0xCCD9B77F70D31C9D', this.handle, rai()); } /** * @param weaponHash * @returns */ getWeaponDamage(weaponHash: eWeaponHash): float { return inv('0xFE0304050261442C', this.handle, weaponHash, raf()); } /** * Sets the behavior of sprinting while the Eagleeye feature is active, determining whether sprinting cancels the effect based on the specified parameter. * old name was _EAGLE_EYE_SET_PLUS_FLAG_DISABLED this native can still be used as its declared. * * @param disabled */ eagleeyeSetSprintBehavior(disabled: boolean): void { inv('0xCE285A4413B00B7F', this.handle, disabled); } /** * @param speech */ set InteractionNegativeResponse(speech: string) { inv('0x98CD760DE43B612E', this.handle, speech); } /** * @param speech * @returns The instance for method chaining */ setInteractionNegativeResponse(speech: string): this { inv('0x98CD760DE43B612E', this.handle, speech); return this; } /** * Params: p1, p2, p3, p4 = 1.f, 0, 0, 0 in R* Scripts * _SPECIAL_ABILITY* * * @param p1 * @param p2 * @param p3 * @param p4 */ N_0xFA437FA0738C370C(p1: float, p2: int, p3: int, p4: int): void { inv('0xFA437FA0738C370C', this.handle, f(p1), p2, p3, p4); } /** * @param toggle */ set SimulateAiming(toggle: boolean) { inv('0xE0447DEF81CCDFD2', this.handle, toggle); } /** * @param toggle * @returns The instance for method chaining */ setSimulateAiming(toggle: boolean): this { inv('0xE0447DEF81CCDFD2', this.handle, toggle); return this; } /** * @returns */ get AiDefenseModifierAgainstAi(): float { return inv('0x2E78D822208E740A', this.handle, raf()); } /** * Setting player's Health recharge time to zero forces immediate health regen * * @param modifier */ set HealthRechargeTimeModifier(modifier: float) { inv('0x535ED4605F89AB6E', this.handle, f(modifier)); } /** * Setting player's Health recharge time to zero forces immediate health regen * * @param modifier * @returns The instance for method chaining */ setHealthRechargeTimeModifier(modifier: float): this { inv('0x535ED4605F89AB6E', this.handle, f(modifier)); return this; } /** * Returns true if the given player has a valid ped. * * @returns */ networkHasValidPed(): any { return inv('0x0760D6F70EBCC05C', this.handle); } /** * @param accuracy */ set RemoteAccuracyFloorModifier(accuracy: float) { inv('0xDEE80FEDFDD43C9B', this.handle, f(accuracy)); } /** * @param accuracy * @returns The instance for method chaining */ setRemoteAccuracyFloorModifier(accuracy: float): this { inv('0xDEE80FEDFDD43C9B', this.handle, f(accuracy)); return this; } /** * @param weapon * @param speed * @returns The instance for method chaining */ setWeaponDrawSpeed(weapon: string | number, speed: float): this { inv('0x00EB5A760638DB55', this.handle, _h(weapon), f(speed)); return this; } /** * @returns */ get StaminaDepletionMultiplier(): float { return inv('0x68A0389E0718AC8F', this.handle, raf()); } /** * @returns */ get CurrentStealthNoise(): float { return inv('0xD7ECC25E176ECBA5', this.handle, raf()); } /** * @param ped * @returns */ isFollowingTarget(ped: Ped): boolean { return !!inv('0xE24C64D9ADED2EF5', this.handle, ped.handle, rai()); } /** * mood: https://github.com/Halen84/RDR3-Native-Flags-And-Enums/tree/main/ePedMood * * @param mood */ set Mood(mood: int) { inv('0x39BED552DB46FFA9', this.handle, mood); } /** * mood: https://github.com/Halen84/RDR3-Native-Flags-And-Enums/tree/main/ePedMood * * @param mood * @returns The instance for method chaining */ setMood(mood: int): this { inv('0x39BED552DB46FFA9', this.handle, mood); return this; } /** * Params: See 0x0751D461F06E41CE * * @param ped * @param promptType * @param promptMode * @param enabled */ modifyUiPromptForPed(ped: Ped, promptType: int, promptMode: int, enabled: boolean): void { inv('0xA3DB37EDF9A74635', this.handle, ped.handle, promptType, promptMode, enabled); } /** * Used in script function INIT_DEADEYE_SLOWDOWN * * @param p1 */ N_0x3ACAC8832E77BC93(p1: boolean): void { inv('0x3ACAC8832E77BC93', this.handle, p1); } /** * Disables the players ability to be wanted by lawmen * * @param disable */ set DisableWantedLevel(disable: boolean) { inv('0x8674D138391FFB1B', this.handle, disable); } /** * Disables the players ability to be wanted by lawmen * * @param disable * @returns The instance for method chaining */ setDisableWantedLevel(disable: boolean): this { inv('0x8674D138391FFB1B', this.handle, disable); return this; } /** * Disables the previously set interactive focus mode preset for a given player. see `_SET_PLAYER_INTERACTIVE_FOCUS_PRESET - 0x3C1B1807C7A415D6` * * @param name */ disableInteractiveFocusPreset(name: string): void { inv('0xC67A4910425F11F1', this.handle, name); } /** * @param p1 */ set ManageBuffSuperJump(p1: float) { inv('0x292F0B6EDC82E3A4', this.handle, f(p1)); } /** * @param p1 * @returns The instance for method chaining */ setManageBuffSuperJump(p1: float): this { inv('0x292F0B6EDC82E3A4', this.handle, f(p1)); return this; } /** * @param multiplier */ set SpecialAbilityMultiplier(multiplier: float) { inv('0x5A498FCA232F71E1', this.handle, f(multiplier)); } /** * @param multiplier * @returns The instance for method chaining */ setSpecialAbilityMultiplier(multiplier: float): this { inv('0x5A498FCA232F71E1', this.handle, f(multiplier)); return this; } /** * @param accuracy */ set LocalAccuracyFloorModifier(accuracy: float) { inv('0x4EA69188FBCE6A7D', this.handle, f(accuracy)); } /** * @param accuracy * @returns The instance for method chaining */ setLocalAccuracyFloorModifier(accuracy: float): this { inv('0x4EA69188FBCE6A7D', this.handle, f(accuracy)); return this; } /** * @param wantedLevel * @returns */ isWantedLevelGreater(wantedLevel: int): boolean { return !!inv('0xE1C0AD4C24324C36', this.handle, wantedLevel, rai()); } /** * SPECIAL_ABILITY_NONE = -1, * SPECIAL_ABILITY_CAR_SLOWDOWN, * SPECIAL_ABILITY_RAGE, * SPECIAL_ABILITY_BULLET_TIME, * SPECIAL_ABILITY_SNAPSHOT, * SPECIAL_ABILITY_INSULT, * SPECIAL_ABILITY_DEADEYE, * SPECIAL_ABILITY_REVIVE * * @param type */ set SpecialAbilityType(type: int) { inv('0x00BA333DA05ADC23', this.handle, type); } /** * SPECIAL_ABILITY_NONE = -1, * SPECIAL_ABILITY_CAR_SLOWDOWN, * SPECIAL_ABILITY_RAGE, * SPECIAL_ABILITY_BULLET_TIME, * SPECIAL_ABILITY_SNAPSHOT, * SPECIAL_ABILITY_INSULT, * SPECIAL_ABILITY_DEADEYE, * SPECIAL_ABILITY_REVIVE * * @param type * @returns The instance for method chaining */ setSpecialAbilityType(type: int): this { inv('0x00BA333DA05ADC23', this.handle, type); return this; } /** * @param toggle */ set EveryoneIgnorePlayer(toggle: boolean) { inv('0x34630A768925B852', this.handle, toggle); } /** * @param toggle * @returns The instance for method chaining */ setEveryoneIgnorePlayer(toggle: boolean): this { inv('0x34630A768925B852', this.handle, toggle); return this; } /** * Sets whether this player can take cover. * * @param toggle */ set CanUseCover(toggle: boolean) { inv('0x5EDA520F7A3BAF4E', this.handle, toggle); } /** * Sets whether this player can take cover. * * @param toggle * @returns The instance for method chaining */ setCanUseCover(toggle: boolean): this { inv('0x5EDA520F7A3BAF4E', this.handle, toggle); return this; } /** * @param ped */ removeAsFollowTarget(ped: Ped): void { inv('0x0C6B89876262A99D', this.handle, ped.handle); } /** * @param weaponGroup * @param modifier * @returns The instance for method chaining */ setWeaponGroupDamageModifier(weaponGroup: string | number, modifier: float): this { inv('0xFC79DCC94D0A5897', this.handle, _h(weaponGroup), f(modifier)); return this; } /** * @param ped * @param p2 */ N_0x84481018E668E1B8(ped: Ped, p2: any): void { inv('0x84481018E668E1B8', this.handle, ped.handle, p2); } /** * @param entity * @param p2 */ registerEagleEyeTrailsForEntity(entity: Entity, p2: any): void { inv('0xAC67098A1E54ABB0', this.handle, entity.handle, p2); } /** * @param filter */ set DeadeyeTaggingConfig(filter: int) { inv('0x83FCD6921FC8FD05', this.handle, filter); } /** * @param filter * @returns The instance for method chaining */ setDeadeyeTaggingConfig(filter: int): this { inv('0x83FCD6921FC8FD05', this.handle, filter); return this; } /** * (Un)lock Eagle Eye functionality * * @param enable */ enableEagleeye(enable: boolean): void { inv('0xA63FCAD3A6FEC6D2', this.handle, enable); } /** * Only used in R* SP Script short_update * Restores Deadeye Outer Ring * * @param amount */ specialAbilityRestoreOuterRing(amount: float): void { inv('0x2498035289B5688F', this.handle, f(amount)); } /** * @returns */ get IsSpecialAbilityActive(): boolean { return !!inv('0xB16223CB7DA965F0', this.handle, rai()); } reportPoliceSpottedPlayer(): void { inv('0xCBCCF73FFA69CC6B', this.handle); } /** * @param p1 * @param p2 * @returns */ getReceivedBattleEventRecently(p1: int, p2: boolean): boolean { return !!inv('0xFB6EB8785F808551', this.handle, p1, p2, rai()); } /** * @returns */ get SpecialAbilityMultiplier(): float { return inv('0xAB3773E7AA1E9DCC', this.handle, raf()); } /** * Sets the weapon that the specified player will aim with. The weapon must already be assigned to the PED. This also determines the weapon order, specifying which weapon the player will automatically switch to when the current weapon runs out of ammo. * * @param weapon * @param attachSlotId * @returns The instance for method chaining */ setAimWeapon(weapon: string | number, attachSlotId: int): this { inv('0xCFFC3ECCD7A5CCEB', this.handle, _h(weapon), attachSlotId); return this; } /** * @param pos * @param heading * @param p5 * @param p6 * @param p7 * @param p8 */ startTeleport(pos: Vector3, heading: float, p5: boolean, p6: boolean, p7: boolean, p8: boolean): void { inv('0xDF8822C55EDDA65B', this.handle, f(pos.x), f(pos.y), f(pos.z), f(heading), p5, p6, p7, p8); } /** * _IS_PLAYER_A* - _IS_PLAYER_BE* * * @param ped * @returns */ N_0xE7F8707269544B29(ped: Ped): boolean { return !!inv('0xE7F8707269544B29', this.handle, ped.handle, rai()); } /** * @returns */ get IsScriptControlOn(): boolean { return !!inv('0xB78350754157C00F', this.handle, rai()); } /** * @returns */ get IsSecondarySpecialAbilityActive(): boolean { return !!inv('0x45AB66D02B601FA7', this.handle, rai()); } N_0xC900A465364A85D6(): void { inv('0xC900A465364A85D6', this.handle); } /** * Returns the group ID the player is member of. * * @returns */ get Group(): int { return inv('0x9BAB31815159ABCF', this.handle, rai()); } /** * Sets stamina core drains peed using ranged damage scale and melee damage scale * * @param weaponDefenseMod * @param meleeDefenseMod * @returns The instance for method chaining */ setDefenseModifier(weaponDefenseMod: float, meleeDefenseMod: float): this { inv('0x497A6539BB0E8787', this.handle, f(weaponDefenseMod), f(meleeDefenseMod)); return this; } /** * This modifies the damage value of your weapon. Whether it is a multiplier or base damage is unknown. * * @param modifier */ set WeaponDamageModifier(modifier: float) { inv('0x94D529F7B73D7A85', this.handle, f(modifier)); } /** * This modifies the damage value of your weapon. Whether it is a multiplier or base damage is unknown. * * @param modifier * @returns The instance for method chaining */ setWeaponDamageModifier(modifier: float): this { inv('0x94D529F7B73D7A85', this.handle, f(modifier)); return this; } /** * durationCost: per second * * @param durationCost */ set SpecialAbilityDurationCost(durationCost: float) { inv('0xB783F75940B23014', this.handle, f(durationCost)); } /** * durationCost: per second * * @param durationCost * @returns The instance for method chaining */ setSpecialAbilityDurationCost(durationCost: float): this { inv('0xB783F75940B23014', this.handle, f(durationCost)); return this; } /** * @returns */ get IsTargettingAnything(): boolean { return !!inv('0x4605C66E0F935F83', this.handle, rai()); } /** * @param modifier */ eagleEyeSetDrainRateModifier(modifier: float): void { inv('0xE0D6C2A146A5C993', this.handle, f(modifier)); } /** * @returns */ get DeadEye(): float { return inv('0xA81D24AE0AF99A5E', this.handle, raf()); } /** * @returns */ get IsInScope(): boolean { return !!inv('0x04D7F33640662FA2', this.handle, rai()); } /** * SET_PLAYER_S/T* * * @param toggle */ N_0x8591EE69CC3ED257(toggle: boolean): void { inv('0x8591EE69CC3ED257', this.handle, toggle); } /** * @param speedBoost * @param duration */ boostHorseSpeedForTime(speedBoost: float, duration: int): void { inv('0x09C28F828EE674FA', this.handle, f(speedBoost), duration); } /** * @param horse * @returns */ setPedAsTempHorse(horse: Ped): any { return inv('0x227B06324234FB09', this.handle, horse.handle); } /** * Restores Deadeye by given amount. * Params: p2, p3, p4 = 0, 0, 1 in R* Scripts * * @param amount * @param p2 * @param p3 * @param p4 */ specialAbilityRestoreByAmount(amount: float, p2: int, p3: int, p4: int): void { inv('0x51345AE20F22C261', this.handle, f(amount), p2, p3, p4); } /** * Only used in R* SP Script short_update * * @param delay */ set DeadeyeAbilityDepletionDelay(delay: float) { inv('0x870634493CB4372C', this.handle, f(delay)); } /** * Only used in R* SP Script short_update * * @param delay * @returns The instance for method chaining */ setDeadeyeAbilityDepletionDelay(delay: float): this { inv('0x870634493CB4372C', this.handle, f(delay)); return this; } /** * Swim speed multiplier. * Multiplier goes up to 1.49f * * @param multiplier */ set SwimMultiplierForPlayer(multiplier: float) { inv('0xBFCEABDE34DA5085', this.handle, f(multiplier)); } /** * Swim speed multiplier. * Multiplier goes up to 1.49f * * @param multiplier * @returns The instance for method chaining */ setSwimMultiplierForPlayer(multiplier: float): this { inv('0xBFCEABDE34DA5085', this.handle, f(multiplier)); return this; } /** * @returns */ get IsDead(): boolean { return !!inv('0x2E9C3FCB6798F397', this.handle, rai()); } /** * @param ped * @param p2 */ N_0x310CE349E0C0EC4B(ped: Ped, p2: int): void { inv('0x310CE349E0C0EC4B', this.handle, ped.handle, p2); } /** * Clears all Eagle Eye trails that were registered for entities associated with the specified player. */ eagleEyeClearRegisteredTrails(): void { inv('0xE5D3EB37ABC1EB03', this.handle); } /** * @param enable */ enableCustomDeadeyeAbility(enable: boolean): void { inv('0x95EE1DEE1DCD9070', this.handle, enable); } /** * Returns the player's invincibility status. * * @returns */ get Invincible(): boolean { return !!inv('0x0CBBCB2CCFA7DC4E', this.handle, rai()); } resetArrestState(): void { inv('0x12917931C31F1750', this.handle); } /** * Toggle handles wether Deadeye and Eagleeye are infinite or not. * * @param toggle */ modifyInfiniteTrailVision(toggle: boolean): void { inv('0x28A13BF6B05C3D83', this.handle, toggle); } /** * Simply sets you as invincible (Health will not deplete). * * @param toggle */ set Invincible(toggle: boolean) { inv('0xFEBEEBC9CBDF4B12', this.handle, toggle); } /** * Simply sets you as invincible (Health will not deplete). * * @param toggle * @returns The instance for method chaining */ setInvincible(toggle: boolean): this { inv('0xFEBEEBC9CBDF4B12', this.handle, toggle); return this; } /** * Returns whether the player can control himself. * * @returns */ get IsControlOn(): boolean { return !!inv('0x7964097FCE4C244B', this.handle, rai()); } /** * @param vehicle */ set MayOnlyEnterThisVehicle(vehicle: Vehicle) { inv('0xDA35A134038557EC', this.handle, vehicle.handle); } /** * @param vehicle * @returns The instance for method chaining */ setMayOnlyEnterThisVehicle(vehicle: Vehicle): this { inv('0xDA35A134038557EC', this.handle, vehicle.handle); return this; } /** * Sets Player's Defense against AI modifier * * @param modifier */ set AiDefenseModifierAgainstAi(modifier: float) { inv('0x914071FF93AF2692', this.handle, f(modifier)); } /** * Sets Player's Defense against AI modifier * * @param modifier * @returns The instance for method chaining */ setAiDefenseModifierAgainstAi(modifier: float): this { inv('0x914071FF93AF2692', this.handle, f(modifier)); return this; } /** * Gets the player's team. * Returns -1 in singleplayer. * * @returns */ get Team(): int { return inv('0xB464EB6A40C7975B', this.handle, rai()); } /** * @returns */ get HealthRechargeMultiplier(): float { return inv('0x22CD23BB0C45E0CD', this.handle, raf()); } /** * Used in script function: NET_AUTO_FOLLOW_UPDATE_LEADER_VALUES * followMode: * HORSEFOLLOWMODE_AUTO = 0, * HORSEFOLLOWMODE_SIDE_ONLY, * HORSEFOLLOWMODE_BEHIND_ONLY, * HORSEFOLLOWMODE_BEHIND_AND_SIDE, * HORSEFOLLOWMODE_BEHIND_CLOSE * followPriority: * HORSEFOLLOWPRIORITY_STEER_ASSIST = 0, * HORSEFOLLOWPRIORITY_AMBIENT, * HORSEFOLLOWPRIORITY_NORMAL, * HORSEFOLLOWPRIORITY_HIGH * * @param ped * @param p2 * @param p3 * @param followMode * @param followPriority * @param p6 */ addAsFollowTarget(ped: Ped, p2: float, p3: float, followMode: int, followPriority: int, p6: boolean): void { inv('0xAC22AA6DF4D1C1DE', this.handle, ped.handle, f(p2), f(p3), followMode, followPriority, p6); } /** * Sets the stand prompt for a specific player using a predefined text entry. use AddTextEntry for promptTextKey for custom names * * @param promptTextKey */ set PromptLeaveText(promptTextKey: string) { inv('0x06C3DB00B69D5435', this.handle, promptTextKey); } /** * Sets the stand prompt for a specific player using a predefined text entry. use AddTextEntry for promptTextKey for custom names * * @param promptTextKey * @returns The instance for method chaining */ setPromptLeaveText(promptTextKey: string): this { inv('0x06C3DB00B69D5435', this.handle, promptTextKey); return this; } /** * Retrieves the number of marks placed on a PED when Deadeye mode is active for the specified player. * * @param ped * @returns */ getNumDeadeyeMarksOnPed(ped: Ped): any { return inv('0x27AD7162D3FED01E', this.handle, ped.handle); } /** * @returns */ get Ped2(): Ped | null { return createFromHandle('Ped', inv('0x5EBE38A20BC51C27', this.handle, rai())); } /** * @param p1 * @returns */ getIsUiPromptActive(p1: int): any { return inv('0x51BEA356B1C60225', this.handle, p1); } /** * @param weaponGroup * @param toggle * @returns The instance for method chaining */ setWeaponGroupAsInstantKill(weaponGroup: string | number, toggle: boolean): this { inv('0x59F0AFF3E0A1B019', this.handle, _h(weaponGroup), toggle); return this; } /** * Returns false if PromptType is enabled * Params: See 0x0751D461F06E41CE * * @param promptType * @param promptMode * @returns */ getUiPromptIsDisabled(promptType: int, promptMode: int): any { return inv('0x6614F9039BD31931', this.handle, promptType, promptMode); } /** * @param toggle */ set LockonToFriendlyPlayers(toggle: boolean) { inv('0x4A056257802DD3E5', this.handle, toggle); } /** * @param toggle * @returns The instance for method chaining */ setLockonToFriendlyPlayers(toggle: boolean): this { inv('0x4A056257802DD3E5', this.handle, toggle); return this; } /** * Activates the Surrender prompt for the specified player in the current frame. * * @param targetPed * @param promptOrder * @param p3 * @returns The instance for method chaining * @example * ```lua * // Calm targetPed * Citizen.InvokeNative(0x3A2A2071DF5CC569,targetPed,PlayerPedId(),2) * //Register lockon prompt to targetPed * Citizen.InvokeNative(0x870708A6E147A9AD,targetPed,"",10.1,10.1, 0, 0.0, 0.0, 0, false, -1) * * // Activate the surrender prompt for the current player towards the targetPed * while true do * Wait(0) * Citizen.InvokeNative(0xCBB54CC7FFFFAB86,PlayerId(),targetPed,1, false) * //_SET_PLAYER_SURRENDER_PROMPT_THIS_FRAME(PlayerId(), targetPed, 1, false); * end * ``` */ setCooperatePromptThisFrame(targetPed: Ped, promptOrder: int, p3: boolean): this { inv('0xCBB54CC7FFFFAB86', this.handle, targetPed.handle, promptOrder, p3); return this; } /** * https://github.com/Halen84/RDR3-Native-Flags-And-Enums/tree/main/ePlayerResetFlags * https://github.com/femga/rdr3_discoveries/tree/master/AI/PLAYER_RESET_FLAGS * * @param playerResetFlag * @param p2 * @returns The instance for method chaining */ setResetFlag(playerResetFlag: int, p2: boolean): this { inv('0x9F9A829C6751F3C7', this.handle, playerResetFlag, p2); return this; } /** * @returns */ get WantedLevel(): int { return inv('0xABC532F9098BFD9D', this.handle, rai()); } /** * @param closeRangeLowerBound * @param closeRangeUpperBound * @returns The instance for method chaining */ setDamageCloseDistanceBonus(closeRangeLowerBound: float, closeRangeUpperBound: float): this { inv('0x7761A30432C91297', this.handle, f(closeRangeLowerBound), f(closeRangeUpperBound)); return this; } /** * @param multiplier */ set SneakingNoiseMultiplier(multiplier: float) { inv('0x4DE44FA389DCA565', this.handle, f(multiplier)); } /** * @param multiplier * @returns The instance for method chaining */ setSneakingNoiseMultiplier(multiplier: float): this { inv('0x4DE44FA389DCA565', this.handle, f(multiplier)); return this; } /** * Sets the player's team. * * @param team * @param bRestrictToThisScript * @returns The instance for method chaining */ setTeam(team: int, bRestrictToThisScript: boolean): this { inv('0xE8DD8536F01DE600', this.handle, team, bRestrictToThisScript); return this; } /** * Checks if the player's Deadeye ability is enabled. * * @returns */ get IsSpecialAbilityEnabled(): boolean { return !!inv('0xDE6C85975F9D4894', this.handle, rai()); } /** * @param target */ set BountyTarget(target: Player) { inv('0x6ADF821FBF21920E', this.handle, target.handle); } /** * @param target * @returns The instance for method chaining */ setBountyTarget(target: Player): this { inv('0x6ADF821FBF21920E', this.handle, target.handle); return this; } /** * Retrieves whether all trails are currently hidden during Eagle Eye mode for the specified player. * * @returns */ eagleEyeAreAllTrailsHidden(): any { return inv('0xA62BBAAE67A05BB0', this.handle); } /** * @returns */ get IsDeadeyeTaggingEnabled(): any { return inv('0x32348719DCED2969', this.handle); } /** * Returns true if PromptType is enabled for ped (mount) * Params: See 0x0751D461F06E41CE * * @param ped * @param promptType * @param promptMode * @returns */ getUiPromptForPedIsEnabled(ped: Ped, promptType: int, promptMode: int): any { return inv('0xEA8F168A76A0B9BC', this.handle, ped.handle, promptType, promptMode); } /** * Applies a aura effect to nearby entities when Deadeye is active, based on a flag parameter. This includes humans, animals, vehicles, and horses pulling those vehicles. Additionally, depending on the flag value, the player's appearance may change (e.g., turning gray). * * @param flag */ set DeadeyeEntityAuraWithFlag(flag: int) { inv('0x2B12B6FC8B8772AB', this.handle, flag); } /** * Applies a aura effect to nearby entities when Deadeye is active, based on a flag parameter. This includes humans, animals, vehicles, and horses pulling those vehicles. Additionally, depending on the flag value, the player's appearance may change (e.g., turning gray). * * @param flag * @returns The instance for method chaining */ setDeadeyeEntityAuraWithFlag(flag: int): this { inv('0x2B12B6FC8B8772AB', this.handle, flag); return this; } /** * @returns */ get MountOwnedByPlayer(): Ped | null { return createFromHandle('Ped', inv('0xF49F14462F0AE27C', this.handle, rai())); } /** * @param weaponHash * @param damageModifier Refer to {@link eWeaponHash} * @returns The instance for method chaining */ setWeaponTypeDamageModifier(weaponHash: eWeaponHash, damageModifier: float): this { inv('0xD04AD186CE8BB129', this.handle, weaponHash, f(damageModifier)); return this; } /** * Only used in script function PROCESS_PED_INTERRUPT_DIALOGUE * *GET_PLAYER** * * @returns ped */ N_0x7AE93C45EC14A166(): [boolean, Ped | null] { const result = inv<[boolean, number]>('0x7AE93C45EC14A166', this.handle, pvi(), rai()); return [!!result[0], createFromHandle('Ped', result[1])]; } /** * @param speed * @param duration * @param heading * @param p4 * @param p5 */ simulateInputGait(speed: float, duration: int, heading: float, p4: boolean, p5: boolean): void { inv('0xFA0C063C422C4355', this.handle, f(speed), duration, f(heading), p4, p5); } /** * @param p1 * @returns */ getDeadEyeMeterLevel(p1: boolean): float { return inv('0x3A6AE4EEE30370FE', this.handle, p1, raf()); } /** * @param drawReductionTime */ set BowDrawReductionTimeInDeadeye(drawReductionTime: float) { inv('0xBE0C524970892D41', this.handle, f(drawReductionTime)); } /** * @param drawReductionTime * @returns The instance for method chaining */ setBowDrawReductionTimeInDeadeye(drawReductionTime: float): this { inv('0xBE0C524970892D41', this.handle, f(drawReductionTime)); return this; } /** * Checks if the player can focus on tracks while in Eagle Eye mode. Returns true if the player is able to focus on a track, otherwise false. * * @returns */ eagleEyeCanFocusOnTrack(): any { return inv('0x1DA5C5B0923E1B85', this.handle); } /** * @param range */ eagleEyeSetRange(range: float): void { inv('0x22C8B10802301381', this.handle, f(range)); } /** * *SET_SPECIAL_ABILITY** * * @param p1 */ N_0x4D1699543B1C023C(p1: float): void { inv('0x4D1699543B1C023C', this.handle, f(p1)); } /** * Drains Deadeye by given amount. * * @param amount * @param p2 */ specialAbilityDrainByAmount(amount: float, p2: any): void { inv('0x200114E99552462B', this.handle, f(amount), p2); } /** * Returns true if the player is riding a train. * * @returns */ get IsRidingTrain(): boolean { return !!inv('0x2FB0ACADA6A238DD', this.handle, rai()); } /** * Sets whether all trails are hidden during Eagle Eye mode. * * @param hide */ eagleEyeSetHideAllTrails(hide: boolean): void { inv('0x330CA55A3647FA1C', this.handle, hide); } /** * _IS_PLAYER_S* - _IS_PLAYER_T* * * @returns */ N_0x621D1B289CAF5978(): boolean { return !!inv('0x621D1B289CAF5978', this.handle, rai()); } /** * Decreases the damage the player receives while on horseback * Previous name: _SET_RECEIVED_HORSEBACK_DAMAGE_DECREASE * * @param damageDecrease */ set ReceivedDamageTakenOnHorsebackModifier(damageDecrease: float) { inv('0xB427911EA6DFFEF3', this.handle, f(damageDecrease)); } /** * Decreases the damage the player receives while on horseback * Previous name: _SET_RECEIVED_HORSEBACK_DAMAGE_DECREASE * * @param damageDecrease * @returns The instance for method chaining */ setReceivedDamageTakenOnHorsebackModifier(damageDecrease: float): this { inv('0xB427911EA6DFFEF3', this.handle, f(damageDecrease)); return this; } /** * @param toggle */ set CanMercyKill(toggle: boolean) { inv('0x39363DFD04E91496', this.handle, toggle); } /** * @param toggle * @returns The instance for method chaining */ setCanMercyKill(toggle: boolean): this { inv('0x39363DFD04E91496', this.handle, toggle); return this; } /** * @param p1 * @param discoveryHash * @returns */ getHasDiscoveredCharacterNameSp(p1: int, discoveryHash: string | number): any { return inv('0x0772F87D7B07719A', this.handle, p1, _h(discoveryHash)); } /** * @param speech */ set InteractionPositiveResponse(speech: string) { inv('0xC6366A585659D15C', this.handle, speech); } /** * @param speech * @returns The instance for method chaining */ setInteractionPositiveResponse(speech: string): this { inv('0xC6366A585659D15C', this.handle, speech); return this; } /** * This can be between 1.0f - 50.0f * * @param multiplier */ set AirDragMultiplierForPlayersVehicle(multiplier: float) { inv('0x5DA6500FE849DA16', this.handle, f(multiplier)); } /** * This can be between 1.0f - 50.0f * * @param multiplier * @returns The instance for method chaining */ setAirDragMultiplierForPlayersVehicle(multiplier: float): this { inv('0x5DA6500FE849DA16', this.handle, f(multiplier)); return this; } /** * Only applies to HUNTERCART01 * * @param wagon */ set HuntingWagon(wagon: Vehicle) { inv('0x6A4404BDFA62CE2C', this.handle, wagon.handle); } /** * Only applies to HUNTERCART01 * * @param wagon * @returns The instance for method chaining */ setHuntingWagon(wagon: Vehicle): this { inv('0x6A4404BDFA62CE2C', this.handle, wagon.handle); return this; } /** * Applies a customizable aura effect to nearby entities when Deadeye is active, with control over aura intensity and additional behavior based on a flag parameter. * * @param p1 * @param p2 * @param p3 * @param intensity * @param flag * @returns The instance for method chaining */ setDeadeyeEntityAuraIntensityWithFlag(p1: float, p2: float, p3: float, intensity: float, flag: int): this { inv('0x131E294EF60160DF', this.handle, f(p1), f(p2), f(p3), f(intensity), flag); return this; } /** * Gets the player's server ID. In multiplayer, this is the player's unique server-side identifier. */ get ServerId(): number { return inv('0x4D97BCC7', this.handle, rai()); } } registerHandle('Player', Player);