Entity::freezePosition: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
Line 17: Line 17:
</syntaxhighlight>
</syntaxhighlight>
==See also==
==See also==
{{Entity_function_c}}
{{Entity_definition_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Revision as of 17:57, 1 May 2024

Syntax

entity.freezePosition(toggle);

Required Arguments

  • toggle: Boolean

Return value

  • Undefined

Example

// Freeze player position on pressing F2 key
let freeze = false;
mp.keys.bind(0x71, true, function() {
    freeze = !freeze;
    mp.players.local.freezePosition(freeze);
    mp.gui.chat.push(`FreezePosition status: ${freeze}`);
});

See also