PlayerClient

setPlayerLockon

SET_PLAYER_LOCKON0x5C8B2F450EE4328E

The GTA V native SET_PLAYER_LOCKON of the PLAYER namespace, as LS:MP client scripts call it: the global function setPlayerLockon, in JavaScript and in Lua.

SignatureJavaScript
setPlayerLockon(player: Player, toggle: boolean): void
SignatureLua
setPlayerLockon(player: Player, toggle: boolean)

Usage

JavaScript
setPlayerLockon(player, toggle);
Lua
setPlayerLockon(player, toggle)

Parameters

ParameterTypeJavaScriptLua
playerPlayernumberinteger
toggleBOOLbooleanboolean

Returns

Nothing. In JavaScript the call evaluates to undefined.

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

Example from fm_mission_controler.ysc.c4:

setPlayerLockon(playerId(), 1);

All other decompiled scripts using this seem to be using the player id as the first parameter, so I feel the need to confirm it as so.

No need to confirm it says playerId() so it uses playerId() lol.

Reference

Namespace
Player PLAYER
In the game
void SET_PLAYER_LOCKON(Player player, BOOL toggle)
Hash
0x5C8B2F450EE4328E

Open in the interactive natives reference