| Property | Value |
|---|---|
| Native Name | FREEZE_ENTITY_POSITION |
| Hash | 0x428CA6DBD1094446 |
| Return Type | void |
| Parameters | entity (Entity), toggle (BOOL) |
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 SET_ENTITY_COORDS.
Parameters
entity(Entity) — The entity to freeze/unfreeze.toggle(BOOL) — Freeze or unfreeze entity.
Examples
-- Freeze the local player.
-- Retrieve the player ped
local playerPed = PlayerPedId()
-- Freeze the ped
FreezeEntityPosition(playerPed, true)
// Freeze the local player.
// Retrieve the player ped
const playerPed = PlayerPedId();
// Freeze the ped
FreezeEntityPosition(playerPed, true);
using static CitizenFX.Core.Native.API;
// Freeze the local player.
// Retrieve the player ped
int playerPed = PlayerPedId();
// Freeze the ped
FreezeEntityPosition(playerPed, true);
// or the preferred use of C# wrapper
Game.PlayerPed.IsPositionFrozen = true;