SetPlayerLockon
DocsSetPlayerLockon(player, toggle)Description
Used to toggle the square up aim.
Parameters
| Name | Type | Description |
|---|---|---|
player | Player | The player ID to toggle the lock on for. |
toggle | BOOL | Set to false to prevent lock on, set to true to allow for lock on. |
Quick Snippet: Get Playerplayer
playerUse this to get the local player ID or a target player's server ID.
-- Get the local player index (client-side)
local playerId = PlayerId()
-- Get the local player's server ID (for server events)
local serverId = GetPlayerServerId(playerId)
print("Player ID: " .. playerId)
print("Server ID: " .. serverId)
-- Get player ped from a server ID:
-- local targetPed = GetPlayerPed(GetPlayerFromServerId(targetServerId))Returns
voidThis native does not return a value.
Examples
Official
local plyId = PlayerId()
SetPlayerLockon(plyId, false)