FreezeEntityPosition
DocsFreezeEntityPosition(entity, toggle)Description
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 <code>SET_ENTITY_COORDS</code>.
This is the server-side RPC native equivalent of the client native [FREEZE_ENTITY_POSITION](?\_0x428CA6DBD1094446).
Parameters
| Name | Type | Description |
|---|---|---|
entity | Entity | The entity to freeze/unfreeze. |
toggle | BOOL | Freeze or unfreeze entity. |
Quick Snippet: Get Entityentity
entityUse this to obtain an entity handle from the player's aim or crosshair.
-- Get the entity the player is aiming at
local ped = PlayerPedId()
local hit, entity = GetEntityPlayerIsFreeAimingAt(PlayerId())
if hit and entity ~= 0 then
print("Entity: " .. entity)
print("Model: " .. GetEntityModel(entity))
print("Type: " .. GetEntityType(entity)) -- 1=Ped, 2=Vehicle, 3=Object
endReturns
voidThis native does not return a value.