class Entity
package fivem.client.natives
Static methods
staticAttachEntityBoneToEntityBone(entity1:Dynamic, entity2:Dynamic, entityBone:Int, entityBone2:Int, p4:Bool, p5:Bool):Dynamic
staticAttachEntityBoneToEntityBonePhysically(entity1:Dynamic, entity2:Dynamic, entityBone:Int, entityBone2:Int, p4:Bool, p5:Bool):Dynamic
staticGetEntityBoneCount(entity:Dynamic):Int
staticGetEntityBonePosition2(entity:Dynamic, boneIndex:Int):Dynamic
Gets the world rotation of the specified bone of the specified entity.
This native is used in casinoroulette.c but I don't know yet what is the difference with _GET_ENTITY_BONE_ROTATIONstaticGetEntityBoneRotation(entity:Dynamic, boneIndex:Int):Dynamic
Gets the world rotation of the specified bone of the specified entity.staticGetEntityBoneRotationLocal(entity:Dynamic, boneIndex:Int):Dynamic
Gets the local rotation of the specified bone of the specified entity.
NativeDB Introduced: v1734staticGetEntityPickup(entity:Dynamic, modelHash:Int):Dynamic
GET_ENTITY_*
Seems to return the handle of the entity's portable pickup.
NativeDB Introduced: v1180staticGetEntityProofs(entity:Dynamic, bulletProof:Dynamic, fireProof:Dynamic, explosionProof:Dynamic, collisionProof:Dynamic, meleeProof:Dynamic, steamProof:Dynamic, p7:Dynamic, drownProof:Dynamic):Bool
NativeDB Introduced: v1604staticHasEntityClearLosToEntity2(entity1:Dynamic, entity2:Dynamic, traceType:Int):Dynamic
NativeDB Introduced: v1868staticSetEntityAngularVelocity(entity:Dynamic, x:Float, y:Float, z:Float):Dynamic
NativeDB Introduced: v2372staticSetEntityCleanupByEngine(entity:Dynamic, toggle:Bool):Dynamic
True means it can be deleted by the engine when switching lobbies/missions/etc, false means the script is expected to clean it up.staticapplyForceToEntity(entity:Dynamic, forceType:Int, x:Float, y:Float, z:Float, offX:Float, offY:Float, offZ:Float, boneIndex:Int, isDirectionRel:Bool, ignoreUpVec:Bool, isForceRel:Bool, p12:Bool, p13:Bool):Dynamic
staticapplyForceToEntityCenterOfMass(entity:Dynamic, forceType:Int, x:Float, y:Float, z:Float, p5:Bool, isDirectionRel:Bool, isForceRel:Bool, p8:Bool):Dynamic
staticattachEntityToEntity(entity1:Dynamic, entity2:Dynamic, boneIndex:Int, xPos:Float, yPos:Float, zPos:Float, xRot:Float, yRot:Float, zRot:Float, p9:Bool, useSoftPinning:Bool, collision:Bool, isPed:Bool, rotationOrder:Int, syncRot:Bool):Dynamic
Attach an entity to the specified entity.
staticattachEntityToEntityPhysically(entity1:Dynamic, entity2:Dynamic, boneIndex1:Int, boneIndex2:Int, xPos1:Float, yPos1:Float, zPos1:Float, xPos2:Float, yPos2:Float, zPos2:Float, xRot:Float, yRot:Float, zRot:Float, breakForce:Float, fixedRot:Bool, p15:Bool, collision:Bool, teleport:Bool, p18:Int):Dynamic
breakForce is the amount of force required to break the bond.
p14 - is always 1 in scripts
p15 - is 1 or 0 in scripts - unknown what it does
p16 - controls collision between the two entities (FALSE disables collision).
p17 - do not teleport entity to be attached to the position of the bone Index of the target entity (if 1, entity will not be teleported to target bone)
p18 - is always 2 in scripts.staticclearEntityLastDamageEntity(entity:Dynamic):Dynamic
This native could affect the arguments of the CEventNetworkEntityDamage game event, by clearing the damaging entity before the event is fired.
staticcreateForcedObject(x:Float, y:Float, z:Float, p3:Dynamic, modelHash:Int, p5:Bool):Dynamic
staticcreateModelHide(x:Float, y:Float, z:Float, radius:Float, model:Int, p5:Bool):Dynamic
p5 = sets as true in scripts
Same as the comment for CREATE_MODEL_SWAP unless for some reason p5 affects it this only works with objects as well.
Network players do not see changes done with this. staticcreateModelHideExcludingScriptObjects(x:Float, y:Float, z:Float, radius:Float, model:Int, p5:Bool):Dynamic
staticcreateModelSwap(x:Float, y:Float, z:Float, radius:Float, originalModel:Int, newModel:Int, p6:Bool):Dynamic
Only works with objects!
Network players do not see changes done with this. staticdeleteEntity(entity:Dynamic):Dynamic
Delete the specified entity, and invalidate the passed handle (i.e., the in/out argument). You might want to check if the entity exists before with DOES_ENTITY_EXIST.
staticdetachEntity(entity:Dynamic, dynamic_:Bool, collision:Bool):Dynamic
staticdoesEntityBelongToThisScript(entity:Dynamic, p2:Bool):Bool
staticdoesEntityHaveDrawable(entity:Dynamic):Bool
staticdoesEntityHavePhysics(entity:Dynamic):Bool
staticfindAnimEventPhase(animDictionary:String, animName:String, p2:String, p3:Dynamic, p4:Dynamic):Bool
In the script "player_scene_t_bbfight.c4":
"if (ENTITY::FIND_ANIM_EVENT_PHASE(&l_16E, &l_19F[v_4/ *16* /], v_9, &v_A, &v_B))"
-- &l_16E (p0) is requested as an anim dictionary earlier in the script.
-- &l_19F[v_4/ *16* /] (p1) is used in other natives in the script as the "animation" param.
-- v_9 (p2) is instantiated as "victim_fall"; I'm guessing that's another anim
--v_A and v_B (p3 & p4) are both set as -1.0, but v_A is used immediately after this native for:
"if (v_A < ENTITY::GET_ENTITY_ANIM_CURRENT_TIME(...))"
Both v_A and v_B are seemingly used to contain both Vector3's and floats, so I can't say what either really is other than that they are both output parameters. p4 looks more like a *Vector3 though
-alphazolam
staticforceEntityAiAndAnimationUpdate(entity:Dynamic):Dynamic
Based on carmod_shop script decompile this takes a vehicle parameter. It is called when repair is done on initial enter. staticfreezeEntityPosition(entity:Dynamic, toggle:Bool):Dynamic
Freezes or unfreezes an entity preventing its coordinates to change by the player if set to true. You can still change the entity position using SET_ENTITY_COORDS.
staticgetCollisionNormalOfLastHitForEntity(entity:Dynamic):Dynamic
staticgetEntityAlpha(entity:Dynamic):Int
staticgetEntityAnimCurrentTime(entity:Dynamic, animDict:String, animName:String):Float
Returns a float value representing animation's current playtime with respect to its total playtime. This value increasing in a range from [0 to 1] and wrap back to 0 when it reach 1.
Example:
0.000000 - mark the starting of animation.
0.500000 - mark the midpoint of the animation.
1.000000 - mark the end of animation.
staticgetEntityAnimTotalTime(entity:Dynamic, animDict:String, animName:String):Float
Returns a float value representing animation's total playtime in milliseconds.
Example:
GET_ENTITY_ANIM_TOTAL_TIME(PLAYER_ID(),"amb@world_human_yoga@female@base","base_b")
return 20800.000000
staticgetEntityAttachedTo(entity:Dynamic):Dynamic
staticgetEntityBoneIndexByName(entity:Dynamic, boneName:String):Int
Returns the index of the bone. If the bone was not found, -1 will be returned.
list:
pastebin.com/D7JMnX1g
BoneNames:
chassis,
windscreen,
seat_pside_r,
seat_dside_r,
bodyshell,
suspension_lm,
suspension_lr,
platelight,
attach_female,
attach_male,
bonnet,
boot,
chassis_dummy, //Center of the dummy
chassis_Control, //Not found yet
door_dside_f, //Door left, front
door_dside_r, //Door left, back
door_pside_f, //Door right, front
door_pside_r, //Door right, back
Gun_GripR,
windscreen_f,
platelight, //Position where the light above the numberplate is located
VFX_Emitter,
window_lf, //Window left, front
window_lr, //Window left, back
window_rf, //Window right, front
window_rr, //Window right, back
engine, //Position of the engine
gun_ammo,
ROPE_ATTATCH, //Not misspelled. In script "finale_heist2b.c4".
wheel_lf, //Wheel left, front
wheel_lr, //Wheel left, back
wheel_rf, //Wheel right, front
wheel_rr, //Wheel right, back
exhaust, //Exhaust. shows only the position of the stock-exhaust
overheat, //A position on the engine(not exactly sure, how to name it)
misc_e, //Not a car-bone.
seat_dside_f, //Driver-seat
seat_pside_f, //Seat next to driver
Gun_Nuzzle,
seat_r
I doubt that the function is case-sensitive, since I found a "Chassis" and a "chassis". - Just tested: Definitely not case-sensitive. staticgetEntityCanBeDamaged(entity:Dynamic):Bool
staticgetEntityCollisionDisabled(entity:Dynamic):Bool
staticgetEntityCoords(entity:Dynamic, alive:Bool):Dynamic
Gets the current coordinates (world position) for a specified entity.
staticgetEntityHeading(entity:Dynamic):Float
Returns the heading of the entity in degrees. Also know as the "Yaw" of an entity.staticgetEntityHeadingFromEulers(entity:Dynamic):Float
Gets the heading of the entity physics in degrees, which tends to be more accurate than just GET_ENTITY_HEADING. This can be clearly seen while, for example, ragdolling a ped/player.
staticgetEntityHealth(entity:Dynamic):Int
Returns an integer value of entity's current health.
Example of range for ped:
- Player [0 to 200]
- Ped [100 to 200]
- Vehicle [0 to 1000]
- Object [0 to 1000]
Health is actually a float value but this native casts it to int.
In order to get the actual value, do:
float health = *(float *)(entityAddress + 0x280);staticgetEntityHeight(entity:Dynamic, X:Float, Y:Float, Z:Float, atTop:Bool, inWorldCoords:Bool):Float
staticgetEntityHeightAboveGround(entity:Dynamic):Float
Return height (z-dimension) above ground.
Example: The pilot in a titan plane is 1.844176 above ground.
How can i convert it to meters?
Everything seems to be in meters, probably this too. staticgetEntityMatrix(entity:Dynamic, forwardVector:Dynamic, rightVector:Dynamic, upVector:Dynamic, position:Dynamic):Dynamic
staticgetEntityMaxHealth(entity:Dynamic):Int
Return an integer value of entity's maximum health.
Example:
- Player = 200 staticgetEntityPitch(entity:Dynamic):Float
staticgetEntityPopulationType(entity:Dynamic):Int
A population type, from the following enum: https://alloc8or.re/gta5/doc/enums/ePopulationType.txt
staticgetEntityQuaternion(entity:Dynamic, x:Dynamic, y:Dynamic, z:Dynamic, w:Dynamic):Dynamic
w is the correct parameter name! staticgetEntityRoll(entity:Dynamic):Float
Displays the current ROLL axis of the entity [-180.0000/180.0000+]
(Sideways Roll) such as a vehicle tipped on its side staticgetEntityRotation(entity:Dynamic, rotationOrder:Int):Dynamic
NOTE: What you use for rotationOrder when getting must be the same as rotationOrder when setting the rotation.
enum eRotationOrder {
// Rotate around the z-axis, then the y-axis and finally the x-axis.
ROT_ZYX = 0,
// Rotate around the y-axis, then the z-axis and finally the x-axis.
ROT_YZX = 1,
// Rotate around the z-axis, then the x-axis and finally the y-axis.
ROT_ZXY = 2,
// Rotate around the x-axis, then the z-axis and finally the y-axis.
ROT_XZY = 3,
// Rotate around the y-axis, then the x-axis and finally the z-axis.
ROT_YXZ = 4,
// Rotate around the x-axis, then the y-axis and finally the z-axis.
ROT_XYZ = 5,
}staticgetEntityRotationVelocity(entity:Dynamic):Dynamic
staticgetEntityScript(entity:Dynamic, script:Dynamic):String
All ambient entities in-world seem to have the same value for the second argument (Any *script), depending on when the scripthook was activated/re-activated. I've seen numbers from ~5 to almost 70 when the value was translated with to_string. The function return value seems to always be 0. staticgetEntitySpeedVector(entity:Dynamic, relative:Bool):Dynamic
Relative can be used for getting speed relative to the frame of the vehicle, to determine for example, if you are going in reverse (-y speed) or not (+y speed). staticgetEntitySubmergedLevel(entity:Dynamic):Float
Get how much of the entity is submerged. 1.0f is whole entity. staticgetEntityUprightValue(entity:Dynamic):Float
staticgetEntityVelocity(entity:Dynamic):Dynamic
staticgetLastMaterialHitByEntity(entity:Dynamic):Int
staticgetNearestPlayerToEntity(entity:Dynamic):Dynamic
staticgetNearestPlayerToEntityOnTeam(entity:Dynamic, team:Int):Dynamic
staticgetObjectIndexFromEntityIndex(entity:Dynamic):Dynamic
Simply returns whatever is passed to it (Regardless of whether the handle is valid or not). staticgetOffsetFromEntityGivenWorldCoords(entity:Dynamic, posX:Float, posY:Float, posZ:Float):Dynamic
Converts world coords (posX - Z) to coords relative to the entity
Example:
posX = 50
posY = 1000
posZ = 60
Entity's coords are: x=30, y=1000, z=60.
All three returned coords will then be in range of [-20,20] depending on rotation of the entity. staticgetOffsetFromEntityInWorldCoords(entity:Dynamic, offsetX:Float, offsetY:Float, offsetZ:Float):Dynamic
Offset values are relative to the entity.
x = left/right
y = forward/backward
z = up/down staticgetPedIndexFromEntityIndex(entity:Dynamic):Dynamic
Simply returns whatever is passed to it (Regardless of whether the handle is valid or not). staticgetVehicleIndexFromEntityIndex(entity:Dynamic):Dynamic
Simply returns whatever is passed to it (Regardless of whether the handle is valid or not). staticgetWorldPositionOfEntityBone(entity:Dynamic, boneIndex:Int):Dynamic
Returns the coordinates of an entity-bone. statichasAnimEventFired(entity:Dynamic, actionHash:Int):Bool
if (ENTITY::HAS_ANIM_EVENT_FIRED(PLAYER::PLAYER_PED_ID(), MISC::GET_HASH_KEY("CreateObject")))statichasCollisionLoadedAroundEntity(entity:Dynamic):Bool
statichasEntityAnimFinished(entity:Dynamic, animDict:String, animName:String, p3:Int):Bool
P3 is always 3 as far as i cant tell
statichasEntityBeenDamagedByAnyObject(entity:Dynamic):Bool
statichasEntityBeenDamagedByAnyPed(entity:Dynamic):Bool
statichasEntityBeenDamagedByAnyVehicle(entity:Dynamic):Bool
statichasEntityBeenDamagedByEntity(entity:Dynamic, damager:Dynamic, bCheckDamagerVehicle:Bool):Bool
statichasEntityClearLosToEntity(entity1:Dynamic, entity2:Dynamic, flags:Int):Bool
Checks if entity1 has a clear line of sight to entity2. So a simple raycast which if it collides with any of the given colliderTypes returns false.
The direction of the check matters with for example bushes, so checking from inside to outside a bush with traceType 256 returns true, but the other way around returns false.
statichasEntityClearLosToEntityInFront(entity1:Dynamic, entity2:Dynamic):Bool
Has the entity1 got a clear line of sight to the other entity2 from the direction entity1 is facing.
This is one of the most CPU demanding BOOL natives in the game; avoid calling this in things like nested for-loops statichasEntityCollidedWithAnything(entity:Dynamic):Bool
Called on tick.
Tested with vehicles, returns true whenever the vehicle is touching any entity.
Note: for vehicles, the wheels can touch the ground and it will still return false, but if the body of the vehicle touches the ground, it will return true. staticisAnEntity(handle:Int):Bool
staticisEntityAMissionEntity(entity:Dynamic):Bool
staticisEntityAPed(entity:Dynamic):Bool
staticisEntityAVehicle(entity:Dynamic):Bool
staticisEntityAnObject(entity:Dynamic):Bool
staticisEntityAtCoord(entity:Dynamic, xPos:Float, yPos:Float, zPos:Float, xSize:Float, ySize:Float, zSize:Float, p7:Bool, p8:Bool, p9:Int):Bool
Checks if entity is within x/y/zSize distance of x/y/z.
Last three are unknown ints, almost always p7 = 0, p8 = 1, p9 = 0 staticisEntityAtEntity(entity1:Dynamic, entity2:Dynamic, xSize:Float, ySize:Float, zSize:Float, p5:Bool, p6:Bool, p7:Int):Bool
Checks if entity1 is within the box defined by x/y/zSize of entity2.
Last three parameters are almost alwasy p5 = 0, p6 = 1, p7 = 0 staticisEntityAttached(entity:Dynamic):Bool
staticisEntityAttachedToAnyObject(entity:Dynamic):Bool
staticisEntityAttachedToAnyPed(entity:Dynamic):Bool
staticisEntityAttachedToAnyVehicle(entity:Dynamic):Bool
staticisEntityAttachedToEntity(from:Dynamic, to:Dynamic):Bool
staticisEntityInAir(entity:Dynamic):Bool
staticisEntityInAngledArea(entity:Dynamic, x1:Float, y1:Float, z1:Float, x2:Float, y2:Float, z2:Float, width:Float, debug:Bool, includez:Bool, p10:Dynamic):Bool
p10 is some entity flag check, also used in IS_ENTITY_AT_ENTITY, IS_ENTITY_IN_AREA and IS_ENTITY_AT_COORD.
See IS_POINT_IN_ANGLED_AREA for the definition of an angled area.
staticisEntityInArea(entity:Dynamic, x1:Float, y1:Float, z1:Float, x2:Float, y2:Float, z2:Float, p7:Bool, p8:Bool, p9:Dynamic):Bool
staticisEntityInWater(entity:Dynamic):Bool
staticisEntityInZone(entity:Dynamic, zone:String):Bool
staticisEntityOccluded(entity:Dynamic):Bool
staticisEntityOnScreen(entity:Dynamic):Bool
Determines whether the screen position of the specified entity is within the 2D bounds of the screen.
This native will not check if the entity is not visible due to being occluded (for example, behind a wall). To check if a entity is on screen and is not occluded, use IS_ENTITY_OCCLUDED.
staticisEntityPlayingAnim(entity:Dynamic, animDict:String, animName:String, taskFlag:Int):Bool
See also IS_SCRIPTED_SCENARIO_PED_USING_CONDITIONAL_ANIM
Taken from ENTITY::IS_ENTITY_PLAYING_ANIM(PLAYER::PLAYER_PED_ID(), "creatures@shark@move", "attack_player", 3)
p4 is always 3 in the scripts.
taskFlag:
2 - Check synchronized scene
staticisEntityStatic(entity:Dynamic):Bool
A static ped will not react to natives like "APPLY_FORCE_TO_ENTITY" or "SET_ENTITY_VELOCITY" and oftentimes will not react to task-natives like "AI::TASK_COMBAT_PED". The only way I know of to make one of these peds react is to ragdoll them (or sometimes to use CLEAR_PED_TASKS_IMMEDIATELY(). Static peds include almost all far-away peds, beach-combers, peds in certain scenarios, peds crossing a crosswalk, peds walking to get back into their cars, and others. If anyone knows how to make a ped non-static without ragdolling them, please edit this with the solution.
^ Attach a phCollider to the ped. staticisEntityTouchingEntity(entity:Dynamic, targetEntity:Dynamic):Bool
staticisEntityTouchingModel(entity:Dynamic, modelHash:Int):Bool
staticisEntityUpright(entity:Dynamic, angle:Float):Bool
staticisEntityUpsidedown(entity:Dynamic):Bool
staticisEntityVisible(entity:Dynamic):Bool
staticisEntityVisibleToScript(entity:Dynamic):Bool
staticisEntityWaitingForWorldCollision(entity:Dynamic):Bool
staticplayEntityAnim(entity:Dynamic, animName:String, animDict:String, p3:Float, loop:Bool, stayInAnim:Bool, p6:Bool, delta:Float, bitset:Dynamic):Bool
delta and bitset are guessed fields. They are based on the fact that most of the calls have 0 or nil field types passed in.
The only time bitset has a value is 0x4000 and the only time delta has a value is during stealth with usually <1.0f values.
staticplaySynchronizedEntityAnim(entity:Dynamic, syncedScene:Int, animation:String, propName:String, p4:Float, p5:Float, p6:Dynamic, p7:Float):Bool
p4 and p7 are usually 1000.0f.
staticplaySynchronizedMapEntityAnim(p0:Float, p1:Float, p2:Float, p3:Float, p4:Dynamic, p5:Dynamic, p6:Dynamic, p7:Dynamic, p8:Float, p9:Float, p10:Dynamic, p11:Float):Bool
staticremoveForcedObject(p0:Dynamic, p1:Dynamic, p2:Dynamic, p3:Dynamic, p4:Dynamic):Dynamic
staticremoveModelHide(x:Float, y:Float, z:Float, radius:Float, model:Int, p5:Bool):Dynamic
p5 requires more research. See also CREATE_MODEL_HIDE and CREATE_MODEL_SWAP.
Network players do not see changes done with this.
staticremoveModelSwap(x:Float, y:Float, z:Float, radius:Float, originalModel:Int, newModel:Int, p6:Bool):Dynamic
staticresetEntityAlpha(entity:Dynamic):Dynamic
staticsetCanAutoVaultOnEntity(entity:Dynamic, toggle:Bool):Dynamic
staticsetCanClimbOnEntity(entity:Dynamic, toggle:Bool):Dynamic
staticsetEntityAlpha(entity:Dynamic, alphaLevel:Int, skin:Bool):Dynamic
This native sets the entity's alpha level.
staticsetEntityAlwaysPrerender(entity:Dynamic, toggle:Bool):Dynamic
staticsetEntityAnimCurrentTime(entity:Dynamic, animDictionary:String, animName:String, time:Float):Dynamic
staticsetEntityAnimSpeed(entity:Dynamic, animDictionary:String, animName:String, speedMultiplier:Float):Dynamic
staticsetEntityAsMissionEntity(entity:Dynamic, scriptHostObject:Bool, bGrabFromOtherScript:Bool):Dynamic
Assigns an existing entity to be owned by the current script. If the entity was not owned by a script yet, this also means the entity will remain persistent until released.
Note that this is not needed right after creating an entity as a script-created entity will automatically be assigned.
staticsetEntityAsNoLongerNeeded(entity:Dynamic):Dynamic
Marks the specified entity (ped, vehicle or object) as no longer needed.
Entities marked as no longer needed, will be deleted as the engine sees fit. staticsetEntityCanBeDamaged(entity:Dynamic, toggle:Bool):Dynamic
staticsetEntityCanBeDamagedByRelationshipGroup(entity:Dynamic, bCanBeDamaged:Bool, relGroup:Int):Dynamic
staticsetEntityCanBeTargetedWithoutLos(entity:Dynamic, toggle:Bool):Dynamic
Sets whether the entity can be targeted without being in line-of-sight. staticsetEntityCollision(entity:Dynamic, toggle:Bool, keepPhysics:Bool):Dynamic
staticsetEntityCompletelyDisableCollision(entity:Dynamic, toggle:Bool, keepPhysics:Bool):Dynamic
staticsetEntityCoords(entity:Dynamic, xPos:Float, yPos:Float, zPos:Float, alive:Bool, deadFlag:Bool, ragdollFlag:Bool, clearArea:Bool):Dynamic
Sets the coordinates (world position) for a specified entity, offset by the radius of the entity on the Z axis.
staticsetEntityCoordsNoOffset(entity:Dynamic, x:Float, y:Float, z:Float, keepTasks:Bool, keepIK:Bool, doWarp:Bool):Dynamic
Teleports an entity to specified coordinates directly, with options to maintain certain behaviors post-teleportation.
*
* **Note**:
*
* * This native allows precise placement of entities without the usual adjustments for collision or interaction with the environment that may occur with other teleportation natives.
* * The `keepTasks` and `keepIK` parameters are specifically useful for maintaining the current state of a ped, ensuring actions or animations are not abruptly stopped due to the teleportation.
* * Setting `doWarp` to `false` is useful when simulating continuous movement or when the entity should interact with its immediate surroundings upon arrival.
staticsetEntityCoordsWithoutPlantsReset(entity:Dynamic, xPos:Float, yPos:Float, zPos:Float, alive:Bool, deadFlag:Bool, ragdollFlag:Bool, clearArea:Bool):Dynamic
staticsetEntityDynamic(entity:Dynamic, toggle:Bool):Dynamic
staticsetEntityHasGravity(entity:Dynamic, toggle:Bool):Dynamic
staticsetEntityHeading(entity:Dynamic, heading:Float):Dynamic
Set the heading of an entity in degrees also known as "Yaw".
staticsetEntityHealth(entity:Dynamic, health:Int):Dynamic
When setting health for a player ped, the game will clamp the health value to ensure it does not exceed the maximum health. This maximum health can be retrieved by calling GET_PED_MAX_HEALTH. It can also be modified by calling SET_PED_MAX_HEALTH.
When setting the health for non-player peds or entities, the maximum health will be increased if the new health value exceeds the current maximum.
Default health for male peds is 200, for female peds it is 175.
Added parameters
- inflictor: The handle for the entity that caused the damage.
staticsetEntityInvincible(entity:Dynamic, toggle:Bool):Dynamic
Sets a ped or an object totally invincible. It doesn't take any kind of damage. Peds will not ragdoll on explosions and the tazer animation won't apply either.
If you use this for a ped and you want Ragdoll to stay enabled, then do:
*(DWORD *)(pedAddress + 0x188) |= (1 << 9);
Use this if you want to get the invincibility status:
bool IsPedInvincible(Ped ped)
{
auto addr = getScriptHandleBaseAddress(ped);
if (addr)
{
DWORD flag = *(DWORD *)(addr + 0x188);
return ((flag & (1 << 8)) != 0) || ((flag & (1 << 9)) != 0);
}
return false;
} staticsetEntityIsTargetPriority(entity:Dynamic, p1:Bool, p2:Float):Dynamic
staticsetEntityLights(entity:Dynamic, toggle:Bool):Dynamic
staticsetEntityLoadCollisionFlag(entity:Dynamic, toggle:Bool):Dynamic
Loads collision grid for an entity spawned outside of a player's loaded area. This allows peds to execute tasks rather than sit dormant because of a lack of a physics grid.
Certainly not the main usage of this native but when set to true for a Vehicle, it will prevent the vehicle to explode if it is spawned far away from the player.
NativeDB Added Parameter 3: Any p2staticsetEntityLodDist(entity:Dynamic, value:Int):Dynamic
LOD distance can be 0 to 0xFFFF (higher values will result in 0xFFFF) as it is actually stored as a 16-bit value (aka uint16_t). staticsetEntityMaxHealth(entity:Dynamic, value:Int):Dynamic
For instance: ENTITY::SET_ENTITY_MAX_HEALTH(PLAYER::PLAYER_PED_ID(), 200); // director_mode.c4: 67849 staticsetEntityMaxSpeed(entity:Dynamic, speed:Float):Dynamic
staticsetEntityMotionBlur(entity:Dynamic, toggle:Bool):Dynamic
staticsetEntityNoCollisionEntity(entity1:Dynamic, entity2:Dynamic, thisFrameOnly:Bool):Dynamic
Calling this function disables collision between two entities.
The importance of the order for entity1 and entity2 is unclear.
The third parameter, `thisFrame`, decides whether the collision is to be disabled until it is turned back on, or if it's just this frame.staticsetEntityOnlyDamagedByPlayer(entity:Dynamic, toggle:Bool):Dynamic
staticsetEntityOnlyDamagedByRelationshipGroup(entity:Dynamic, p1:Bool, relationshipHash:Int):Dynamic
staticsetEntityProofs(entity:Dynamic, bulletProof:Bool, fireProof:Bool, explosionProof:Bool, collisionProof:Bool, meleeProof:Bool, steamProof:Bool, p7:Bool, drownProof:Bool):Dynamic
Enable / disable each type of damage.
--------------
p7 is to to '1' in am_mp_property_ext/int: entity::set_entity_proofs(uParam0->f_19, true, true, true, true, true, true, 1, true); staticsetEntityQuaternion(entity:Dynamic, x:Float, y:Float, z:Float, w:Float):Dynamic
w is the correct parameter name! staticsetEntityRecordsCollisions(entity:Dynamic, toggle:Bool):Dynamic
staticsetEntityRenderScorched(entity:Dynamic, toggle:Bool):Dynamic
staticsetEntityRequiresMoreExpensiveRiverCheck(entity:Dynamic, toggle:Bool):Dynamic
staticsetEntityRotation(entity:Dynamic, pitch:Float, roll:Float, yaw:Float, rotationOrder:Int, bDeadCheck:Bool):Dynamic
Sets the rotation of a specified entity in the game world.
NativeDB Introduced: v323staticsetEntityTrafficlightOverride(entity:Dynamic, state:Int):Dynamic
Changing traffic-lights will not change the behavior of NPCs.
Example: here
enum eTrafficlightOverrideMode
{
TLO_RED = 0,
TLO_AMBER = 1,
TLO_GREEN = 2,
TLO_NONE = 3
}staticsetEntityVelocity(entity:Dynamic, x:Float, y:Float, z:Float):Dynamic
Note that the third parameter(denoted as z) is "up and down" with positive numbers encouraging upwards movement.staticsetEntityVisible(entity:Dynamic, toggle:Bool, unk:Bool):Dynamic
Toggle the visibility of a given entity.
staticsetObjectAsNoLongerNeeded(object:Dynamic):Dynamic
This is an alias of SET_ENTITY_AS_NO_LONGER_NEEDED. staticsetPedAsNoLongerNeeded(ped:Dynamic):Dynamic
This is an alias of SET_ENTITY_AS_NO_LONGER_NEEDED. staticsetPickUpByCargobobDisabled(entity:Dynamic, toggle:Bool):Dynamic
Configures an entity to either allow or prevent it from being picked up by Cargobobs.
NativeDB Introduced: v1180staticsetVehicleAsNoLongerNeeded(vehicle:Dynamic):Dynamic
This is an alias of SET_ENTITY_AS_NO_LONGER_NEEDED. staticsetWaitForCollisionsBeforeProbe(entity:Dynamic, toggle:Bool):Dynamic
SET_*
Only called within 1 script for x360. 'fm_mission_controller' and it used on an object.
Ran after these 2 natives,
set_object_targettable(uParam0, 0);
set_entity_invincible(uParam0, 1);staticstopEntityAnim(entity:Dynamic, animation:String, animGroup:String, p3:Float):Dynamic
RAGEPluginHook list: docs.ragepluginhook.net/html/62951c37-a440-478c-b389-c471230ddfc5.htm